Ejemplo n.º 1
0
 public void MappingFromEnumToIntClass_ConvertsCorrectly()
 {
     _resourceMapper.ConvertUsing((CustomEnum1 v) => (int)v);
     _resourceMapper.RegisterOneWayMapping <SourceWithEnum, DestWithInt>(
         mapping => mapping.Set(to => to.Enum, (from, to, context) => from.Enum, true)
         );
     _resourceMapper.InitializeMap();
     Assert.AreEqual(1, _resourceMapper.Map <SourceWithEnum, DestWithInt>(new SourceWithEnum {
         Enum = CustomEnum1.Value2
     }, null).Enum);
 }