Assert exception from NUnit to MS TEST

后端 未结 3 1193
终归单人心
终归单人心 2021-01-04 05:10

I have some tests where i am checking for parameter name in exception. How do i write this in MS TEST?

ArgumentNullExc         


        
3条回答
  •  清歌不尽
    2021-01-04 06:01

    Since the MSTest [ExpectedException] attribute doesn't check the text in the message, your best bet is to try...catch and set an Assert on the exception Message / ParamName property.

提交回复
热议问题