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

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

    I think its a bad idea. You want your unit test to test one thing and one thing only. Instead of creating a call through your other test, mock out a call and pass it in as an argument.

提交回复
热议问题