public static void BeforeAllTests(TestContext context) { _mockLogger = Mock.Of <ILogger <VehicleServiceUOW> >(); var optionsBuilder = new DbContextOptionsBuilder <VehicleServiceDbContext>(); _mockServiceDbContext = new VehicleServiceDbContext(optionsBuilder.Options); _mockRepositoryProvider = new Mock <IRepositoryProvider>(); _mockCustomersRepo = new Mock <IRepository <Vehicle> >(); FillVehiclesListSample(); _mockRepositoryProvider.Setup(rep => rep.DbContext).Returns(_mockServiceDbContext); }
public static void BeforeAllTests(TestContext context) { _mockLogger = Mock.Of <ILogger <VehicleServiceUOW> >(); var optionsBuilder = new DbContextOptionsBuilder <VehicleServiceDbContext>(); optionsBuilder.UseInMemoryDatabase(); _mockServiceDbContext = new VehicleServiceDbContext(optionsBuilder.Options); _mockRepositoryProvider = new Mock <IRepositoryProvider>(); _mockCustomersRepo = new Mock <IRepository <Customer> >(); _mockVehiclesRepo = new Mock <IRepository <Vehicle> >(); FillCustomersLookupsDTOsListSample(); FillCustomersWithConnectedVehiclesSample(); FillCustomersListSample(); FillVehiclesListSample(); _mockRepositoryProvider.Setup(rep => rep.DbContext).Returns(_mockServiceDbContext); }
public DbInitializer(VehicleServiceDbContext context) { this._context = context; }