Is Assert.Fail() considered bad practice?

前端 未结 14 1143
面向向阳花
面向向阳花 2021-01-31 07:20

I use Assert.Fail a lot when doing TDD. I\'m usually working on one test at a time but when I get ideas for things I want to implement later I quickly write an empty test where

14条回答
  •  醉话见心
    2021-01-31 07:49

    It was deliberately left out. This is Brad Wilson's reply as to why is there no Assert.Fail():

    We didn't overlook this, actually. I find Assert.Fail is a crutch which implies that there is probably an assertion missing. Sometimes it's just the way the test is structured, and sometimes it's because Assert could use another assertion.

提交回复
热议问题