Is AutoMapper AssertConfigurationIsValid enough to ensure good mapping?

前端 未结 1 1366
隐瞒了意图╮
隐瞒了意图╮ 2021-01-03 20:53

I\'d like to ask you a question about AutoMapper. We are unit testing our mapping like that:

var dtoFiltrePersonne = new DtoFiltrePersonne { Prop1 = \"Test\"         


        
相关标签:
1条回答
  • 2021-01-03 21:24

    It says:

    Executing this code produces an AutoMapperConfigurationException, with a descriptive message. AutoMapper checks to make sure that every single Destination type member has a corresponding type member on the source type.

    Every single member has correlation with destination type. It may not be the right one (since there are always exception cases), but it at least tests that every property is moved from source type to destination.

    0 讨论(0)
提交回复
热议问题