Unit Testing without Assertions

后端 未结 14 2344
夕颜
夕颜 2020-12-17 08:35

Occasionally I come accross a unit test that doesn\'t Assert anything. The particular example I came across this morning was testing that a log file got written to when a co

14条回答
  •  萌比男神i
    2020-12-17 09:00

    If there is no assertion, it isn't a test.

    Quit being lazy -- it may take a little time to figure out how to get the assertion in there, but well worth it to know that it did what you expected it to do.

提交回复
热议问题