本文整理汇总了C#中RealAssert.IsAssignableFrom方法的典型用法代码示例。如果您正苦于以下问题:C# RealAssert.IsAssignableFrom方法的具体用法?C# RealAssert.IsAssignableFrom怎么用?C# RealAssert.IsAssignableFrom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RealAssert
的用法示例。
在下文中一共展示了RealAssert.IsAssignableFrom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: is_assignable_from_e_tipos_diferentes_nao_deve_retornar_execao
public void is_assignable_from_e_tipos_diferentes_nao_deve_retornar_execao()
{
string message = string.Empty;
try
{
IAssert Assert = new RealAssert();
Type expected = typeof(RealAssert);
Type actual = typeof(IServiceProvider);
Assert.IsAssignableFrom(expected, actual);
}
catch (Exception ex)
{
message = ex.Message;
}
}
示例2: is_assignable_from_generico_nao_deve_retornar_execao
public void is_assignable_from_generico_nao_deve_retornar_execao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
object obj = 1;
assert.IsAssignableFrom<IAssert>(obj);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, " Expected: assignable from <Mongeral.Regressao.Framework.Domain.IAssert>\r\n But was: <System.Int32>\r\n");
}
示例3: is_assignable_from_e_tipos_diferentes_e_array_de_object_com_mensagem_nao_deve_retornar_execao
public void is_assignable_from_e_tipos_diferentes_e_array_de_object_com_mensagem_nao_deve_retornar_execao()
{
string message = string.Empty;
try
{
IAssert assert = new RealAssert();
Type expected = typeof(RealAssert);
Type actual = typeof(IServiceProvider);
object[] array = new object[0];
assert.IsAssignableFrom(expected, actual, "mensagem", array);
}
catch (Exception ex)
{
message = ex.Message;
}
Assert.AreEqual(message, " mensagem\r\n Expected: assignable from <Mongeral.Regressao.Framework.Domain.RealAssert>\r\n But was: <System.RuntimeType>\r\n");
}