Injecting AutoMapper profiles in tests

In the newer services at my client, AutoMapper is used to map DTO‘s to database objects and back. Because mocking a mapping isn’t obvious, a lot of behaviour wasn’t tested and that’s unacceptable. Let’s find out how to properly inject an IMapper with actual mappings.

Continue reading “Injecting AutoMapper profiles in tests”