为Nunit Assertion设置自定义异常消息 [英] set custom exception messages for Nunit Assertion
本文介绍了为Nunit Assertion设置自定义异常消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的测试方法中你好
我有很多断言。如果任何条件会失败。该计划将被终止。我需要的是如果发生任何异常我需要设置自定义异常消息。任何人都知道如何继续..
Hi in my test method i have lot of Assertions. if any condition will fail. the program will be terminated. My Need is If any exception Occur i need to set the custom exception Message. Anybody know How to Proceed..
推荐答案
假设您正在检查相同的事情并发生错误,那么您可以显示自定义消息 -
Suppose you are checking for same things and error occure then you can show custom message as -
Assert.AreEqual(Object, Object,Message);
这篇关于为Nunit Assertion设置自定义异常消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文