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 IObjectMapperInstance AddNullableConverters(this IObjectMapperInstance objectMapper)
 {
     objectMapper.AddConverter(new NullableToValue(), new ValueToNullable());
     return(objectMapper);
 }
 public static IObjectMapperInstance AddListAndArrayConverters(this IObjectMapperInstance objectMapper)
 {
     objectMapper.AddConverter(new ListToArray(), new ArrayToList());
     return(objectMapper);
 }
Example #4
0
 public static void AddConverter(params ITypeConverter[] typeConverter)
 {
     Instance.AddConverter(typeConverter);
 }