using Flight.Seats.Dtos; using MapsterMapper; using Unit.Test.Common; using Xunit; namespace Unit.Test.Seat; [Collection(nameof(UnitTestFixture))] public class SeatMappingTests { private readonly UnitTestFixture _fixture; private readonly IMapper _mapper; public SeatMappingTests(UnitTestFixture fixture) { _mapper = fixture.Mapper; } public static IEnumerable Data { get { yield return new object[] { // these types will instantiate with reflection in the future typeof(global::Flight.Seats.Models.SeatReadModel), typeof(SeatDto) }; } } [Theory] [MemberData(nameof(Data))] public void should_support_mapping_from_source_to_destination(Type source, Type destination, params object[] parameters) { var instance = Activator.CreateInstance(source, parameters); _mapper.Map(instance, source, destination); } }