Are multiple asserts bad in a unit test? Even if chaining?

后端 未结 6 1403
借酒劲吻你
借酒劲吻你 2020-12-24 01:23

Is there anything wrong with checking so many things in this unit test?:

ActualModel = ActualResult.AssertViewRendered()        // check 1
                           


        
6条回答
  •  再見小時候
    2020-12-24 01:48

    As long as each assertion has a unique and identifying failure message you should be good and will sidestep any Assertion Roulette issues because it won't be hard to tell which test failed. Use common sense.

提交回复
热议问题