In MSTest, How can I verify exact error message using [ExpectedException(typeof(ApplicationException))]

前端 未结 11 1538
南方客
南方客 2020-12-15 16:01

Using MSTest how can I verify the exact error message coming from a test method? I know [ExpectedException(typeof(ApplicationException), error msg)] doesn\'t co

11条回答
  •  盖世英雄少女心
    2020-12-15 16:46

    With MSTest, you can't do this.

    You already know the solution to this problem: assert the message of an exception in a catch block.

提交回复
热议问题