The question is to make a test that will look at each mapping from the MapperProfile and do a mapping test through .Map(model)
For Example:
private static IMapper _mapper;
public MappingAll()
{
var mappingConfig = new MapperConfiguration(mc =>
{
mc.AddProfile(new Product());
mc.AddProfile(new Apple());
});
var mapper = mappingConfig.CreateMapper();
_mapper = mapper;
}
[Test]
public void TestAll()
{
MapperProvider tt = new MapperProvider(_mapper);
// call some method to check all mappings specified in mappingConfig
tt.CheckAllMappings();
}
I tried to implement it through reflection, but it didn't work fine. There may also be a situation where mapping from an interface to a class can take place