Unit Testing - Is it bad form to have unit test calling other unit tests

后端 未结 8 1937
遥遥无期
遥遥无期 2020-12-10 23:56

I have a unit test called TestMakeAValidCall(). It tests my phone app making a valid call.

I am about to write another test called TestShowCallMe

8条回答
  •  我在风中等你
    2020-12-11 00:47

    IMHO, you should do one of the following:

    • Create a method that returns a valid call, and use it separately for both tests (not one calling the other)
    • Mock the valid call for the ShowCallMessageTest

提交回复
热议问题