public void TestCopyToExistingObject() { TestClassA a = new TestClassA() { TestClassC = new TestClassC() { MyProperty = "string" }, List = new List <TestClassC>() { new TestClassC() { MyProperty = "cstring" }, new TestClassC() { MyProperty = "cstring" }, }, MyProperty = "string", Array = new[] { new TestClassC() { MyProperty = "string", Obj = new TestClassD() { MyProperty = "sstring" } }, new TestClassC() { MyProperty = "string", Obj = new TestClassD() { MyProperty = "sstring" } }, } }; var b = new TestClassB(); a.MapTo(b); Assert.Equal(a.MyProperty, b.MyProperty); Assert.Equal(a.TestClassC.MyProperty, b.TestClassC.MyProperty); Assert.Equal(a.List.Count, b.List.Count); Assert.Equal(a.Array.Length, b.Array.Length); }
public void MapTo_NullSource_Throws_3() { TestClassA source = null; source.MapTo <TestClassB>(A.Fake <IMapper>()); }
public void MapTo_NullSource_Throws_2() { TestClassA source = null; source.MapTo <TestClassB>(); }
public void MapTo_NullSource_Throws_1() { TestClassA source = null; source.MapTo(new TestClassB()); }
public void MapTo_NullSource_Throws_5() { TestClassA source = null; source.MapTo(new TestClassB(), A.Fake <IMapper>()); }
public void MapTo_NullSource_Throws_4() { TestClassA source = null; source.MapTo <TestClassB>(A.Fake <IMappingRepository>()); }