Unit Testing without Assertions

后端 未结 14 2371
夕颜
夕颜 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条回答
  •  误落风尘
    2020-12-17 08:42

    The name of the test should document this.

    void TestLogDoesNotThrowException(void) {
        log("blah blah");
    }
    

    How does the test verify if the log is written without assertion ?

提交回复
热议问题