public void CopyEnumTest() { FromClass1 f1 = new FromClass1() { Id = 3 }; FromClass2 f2 = new FromClass2() { Id = 3 }; FromClass3 f3 = new FromClass3() { Id = TypeCode.Boolean }; FromClass4 f4 = new FromClass4() { Id = TypeCode.Boolean }; Assert.Equal(TypeCode.Boolean, f1.CopyTo <FromClass3>().Id); Assert.Equal(TypeCode.Boolean, f1.CopyTo <FromClass4>().Id); Assert.Equal(TypeCode.Boolean, f2.CopyTo <FromClass3>().Id); Assert.Equal(TypeCode.Boolean, f2.CopyTo <FromClass4>().Id); Assert.Equal(3, f3.CopyTo <FromClass1>().Id); Assert.Equal(3, f3.CopyTo <FromClass2>().Id); Assert.Equal(3, f4.CopyTo <FromClass1>().Id); Assert.Equal(3, f4.CopyTo <FromClass2>().Id); }
public void CopyToEnumTest() { FromClass4 f4_null = new FromClass4() { Id = null }; Assert.Throws <ArgumentNullException>(() => f4_null.CopyTo <FromClass3>()); }
public void CopyEnumTest() { FromClass1 f1 = new FromClass1() { Id = 3 }; FromClass2 f2 = new FromClass2() { Id = 3 }; FromClass3 f3 = new FromClass3() { Id = TypeCode.Boolean }; FromClass4 f4 = new FromClass4() { Id = TypeCode.Boolean }; Assert.Equal(TypeCode.Boolean, f1.CopyTo<FromClass3>().Id); Assert.Equal(TypeCode.Boolean, f1.CopyTo<FromClass4>().Id); Assert.Equal(TypeCode.Boolean, f2.CopyTo<FromClass3>().Id); Assert.Equal(TypeCode.Boolean, f2.CopyTo<FromClass4>().Id); Assert.Equal(3, f3.CopyTo<FromClass1>().Id); Assert.Equal(3, f3.CopyTo<FromClass2>().Id); Assert.Equal(3, f4.CopyTo<FromClass1>().Id); Assert.Equal(3, f4.CopyTo<FromClass2>().Id); }
public void CopyToEnumTest() { FromClass4 f4_null = new FromClass4() { Id = null }; var f3 = f4_null.CopyTo <FromClass3>(); Assert.Equal(default(TypeCode), f3.Id); }
public void CopyToEnumTest() { FromClass4 f4_null = new FromClass4() { Id = null }; var f3 = f4_null.CopyTo<FromClass3>(); Assert.Equal(default(TypeCode), f3.Id); }