本文整理汇总了C#中RealAssert.Throws方法的典型用法代码示例。如果您正苦于以下问题:C# RealAssert.Throws方法的具体用法?C# RealAssert.Throws怎么用?C# RealAssert.Throws使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealAssert
的用法示例。
在下文中一共展示了RealAssert.Throws方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: throws_nao_deve_retornar_execao
public void throws_nao_deve_retornar_execao()
{
IAssert Assert = new RealAssert();
object[] lista = new object[0];
ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
TestDelegate test = new TestDelegate(FazerNada);
Assert.Throws(expression, test);
}
示例2: throws_type__nao_deve_retornar_execao
public void throws_type__nao_deve_retornar_execao()
{
IAssert Assert = new RealAssert();
object[] lista = new object[0];
Type expression = typeof(IAssert);
TestDelegate test = new TestDelegate(FazerNada);
Assert.Throws(expression, test);
}
示例3: throws_com_delegate_mensagem_e_array_de_parametros_nao_deve_retornar_execao
public void throws_com_delegate_mensagem_e_array_de_parametros_nao_deve_retornar_execao()
{
IAssert Assert = new RealAssert();
object[] lista = new object[0];
ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
TestDelegate test = new TestDelegate(FazerNada);
Assert.Throws<Exception>(test, string.Empty, true, true, true, true);
}