Codit / practical-api-guidelines

Practical guidelines for building & designing APIs with .NET.
MIT License
16 stars 5 forks source link

Provide unit tests for contract mappings #31

Closed tomkerkhove closed 5 years ago

tomkerkhove commented 6 years ago

Provide unit tests for contract mappings with AutoMapper.

We currently configure AutoMapper as following:

app.UseAutoMapper(mapperConfig =>
{
    mapperConfig.CreateMap<Entities.Team, Models.TeamDto>();
    mapperConfig.CreateMap<Entities.Team, Models.TeamDetailsDto>();
    mapperConfig.CreateMap<Entities.Player, Models.PlayerDto>();
    mapperConfig.CreateMap<Models.PlayerDto, Entities.Player>();
});

There should be unit tests that make sure that these are still working.