autobus-api_old/AutobusApi.UnitTests/Common/Mappings/MappingTests.cs
2023-11-30 16:18:07 +02:00

32 lines
818 B
C#

using AutobusApi.Application.RouteSearch;
using AutoMapper;
namespace AutobusApi.UnitTests.Common.Mappings;
public class MappingTests : IClassFixture<MappingTestsFixture>
{
private readonly IConfigurationProvider _configuration;
private readonly IMapper _mapper;
public MappingTests(MappingTestsFixture fixure)
{
_configuration = fixure.ConfigurationProvider;
_mapper = fixure.Mapper;
}
[Fact]
public void ShouldHaveValidConfiguraion()
{
_configuration.AssertConfigurationIsValid();
}
[Theory]
// [InlineData(typeof(), typeof())]
public void ShouldSupportMappingFromSourceDoDestination(Type source, Type destination)
{
var instance = Activator.CreateInstance(source);
_mapper.Map(instance, source, destination);
}
}