mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-15 05:25:36 +08:00
27 lines
613 B
C#
27 lines
613 B
C#
using Flight.Data;
|
|
using MapsterMapper;
|
|
using Xunit;
|
|
|
|
namespace Unit.Test.Common
|
|
{
|
|
[CollectionDefinition(nameof(UnitTestFixture))]
|
|
public class FixtureCollection : ICollectionFixture<UnitTestFixture> { }
|
|
|
|
public class UnitTestFixture : IDisposable
|
|
{
|
|
public UnitTestFixture()
|
|
{
|
|
Mapper = MapperFactory.Create();
|
|
DbContext = DbContextFactory.Create();
|
|
}
|
|
|
|
public IMapper Mapper { get; }
|
|
public FlightDbContext DbContext { get; }
|
|
|
|
public void Dispose()
|
|
{
|
|
DbContextFactory.Destroy(DbContext);
|
|
}
|
|
}
|
|
}
|