public void ValueType_String_Object_Is_Always_Primitive() { var sourceDto = new PrimitivePoco { Id = "test", Time = TimeSpan.FromHours(7), }; var targetDto = Mapper.Map <PrimitivePoco, PrimitivePoco>(sourceDto); Assert.Equal(sourceDto.Id, targetDto.Id); Assert.Equal(sourceDto.Time, targetDto.Time); }
public void ValueType_String_Object_Is_Always_Primitive() { var sourceDto = new PrimitivePoco { Id = "test", Time = TimeSpan.FromHours(7), Obj = new object(), }; var targetDto = TypeAdapter.Adapt<PrimitivePoco, PrimitivePoco>(sourceDto); targetDto.Id.ShouldEqual(sourceDto.Id); targetDto.Time.ShouldEqual(sourceDto.Time); targetDto.Obj.ShouldBeSameAs(sourceDto.Obj); }
public void ValueType_String_Object_Is_Always_Primitive() { var sourceDto = new PrimitivePoco { Id = "test", Time = TimeSpan.FromHours(7), Obj = new object(), }; var targetDto = TypeAdapter.Adapt <PrimitivePoco, PrimitivePoco>(sourceDto); targetDto.Id.ShouldBe(sourceDto.Id); targetDto.Time.ShouldBe(sourceDto.Time); targetDto.Obj.ShouldBeSameAs(sourceDto.Obj); }