public void ShouldMapNormalProperty() { // arrange var source = new CompanyModel { CompanyName = "Test Company" }; Mapper.WithRule(new Flattening()); // act var result = Mapper.Map <CompanyDto>(source); // assert Assert.Equal(source.CompanyName, result.CompanyName); }
public void ShouldMapGuidToString() { // arrange var source = new PersonModel { PersonGuid = Guid.NewGuid() }; Mapper.AddConverter(new GuidToString()); // act var result = Mapper.Map <PersonDto>(source); // assert Assert.Equal(source.PersonGuid.ToString(), result.PersonGuid); }
public static TDestination Map <TDestination>(object source) where TDestination : new() { return(Instance.Map <TDestination>(source)); }
public void ShouldMapString() { // arrange var source = new PersonModel { Name = "Test" }; // act var result = Mapper.Map <PersonDto>(source); // assert Assert.Equal(source.Name, result.Name); }