本文整理汇总了C#中RealAssert.That方法的典型用法代码示例。如果您正苦于以下问题:C# RealAssert.That方法的具体用法?C# RealAssert.That怎么用?C# RealAssert.That使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealAssert
的用法示例。
在下文中一共展示了RealAssert.That方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: that_test_delegate_e_expression_e_array_de_object_deve_retornar_excecao_de_expressao
public void that_test_delegate_e_expression_e_array_de_object_deve_retornar_excecao_de_expressao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
object[] lista = new object[0];
ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
TestDelegate del = new TestDelegate(FazerNada);
assert.That(del, expression);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, "A partial expression may not be resolved");
}
示例2: that_object_ref_e_expression_mensagem_e_aray_de_object_deve_retornar_excecao_de_expressao
public void that_object_ref_e_expression_mensagem_e_aray_de_object_deve_retornar_excecao_de_expressao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
object[] lista = new object[0];
ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
assert.That(ref assert, expression, "mensagem", lista);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, "A partial expression may not be resolved");
}
示例3: that_generico__deve_retornar_excecao_de_expressao
public void that_generico__deve_retornar_excecao_de_expressao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
assert.That<IAssert>(ref assert, expression);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, "A partial expression may not be resolved");
}
示例4: that_e_true_com_actual_value_delegate_e_array_de_object_e_mensagem_deve_retornar_excecao_de_expressao
public void that_e_true_com_actual_value_delegate_e_array_de_object_e_mensagem_deve_retornar_excecao_de_expressao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
object[] lista = new object[0];
ActualValueDelegate del = new ActualValueDelegate(SuportDelegate);
ResolvableConstraintExpression expression = new ResolvableConstraintExpression();
assert.That(del, expression, "jhghjg");
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, "A partial expression may not be resolved");
}
示例5: that_e_falso_nao_deve_retornar_execao
public void that_e_falso_nao_deve_retornar_execao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
assert.That(true);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, "Exception of type 'System.Exception' was thrown.");
}
示例6: that_e_falso_com_mensagem_e_array_de_object_nao_deve_retornar_execao
public void that_e_falso_com_mensagem_e_array_de_object_nao_deve_retornar_execao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
object[] lista = new object[0];
assert.That(true, "mensagem", lista);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, "Exception of type 'System.Exception' was thrown.");
}