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

前端 未结 11 1533
南方客
南方客 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:38

    MbUnit can also do this:

    [Test]
    [Row(ExpectedExceptionMessage="my message")]
    void TestBlah(...
    

提交回复
热议问题