How many unit tests should I write per function/method?

后端 未结 12 2143
忘了有多久
忘了有多久 2020-12-05 18:36

Do you write one test per function/method, with multiple checks in the test, or a test for each check?

12条回答
  •  余生分开走
    2020-12-05 18:55

    A testcase per check. If you name the method appropriately, it can provide valuable hint towards the problem when one of these tests cause a regression failure.

提交回复
热议问题