In the project I’m working, we use Automapper 13.0.1
Problem is that one can forget to add a mapping from TSource to TTarget to the Automapper configuration (Profile class) and then we get a runtime error when calling mapper.Map<TTarget>(instance of TSource)
.
We do check with AssertConfigurationIsValid()
as an unit test, but it can’t catch missing mappings.
Is there any way to find out if any of the mapper.Map<TTarget>(instance of TSource)
will fail because of missing mapping?
Integration tests are one option, and we do have them, but that error slipped through by not tested edge case.