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

后端 未结 8 1917
遥遥无期
遥遥无期 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:54

    Yes - unit tests should be separate and should aim to test only one thing (or at least a small number of closely-related things). As an aside, the calls to data.Expect and phone.Expect in your test method are creating expectations rather than stub calls, which can make your tests brittle if you refactor...

提交回复
热议问题