public static void BeforeAllTests(TestContext context) { _mockLogger = Mock.Of <ILogger <VehicleActivityServiceUOW> >(); var optionsBuilder = new DbContextOptionsBuilder <ActivityServiceDbContext>(); optionsBuilder.UseInMemoryDatabase(); _mockServiceDbContext = new ActivityServiceDbContext(optionsBuilder.Options); _mockRepositoryProvider = new Mock <IRepositoryProvider>(); _mockVehicleActivitiesRepo = new Mock <IRepository <VehicleActivity> >(); FillVehiclesActivitiesListSample(); _mockRepositoryProvider.Setup(rep => rep.DbContext).Returns(_mockServiceDbContext); }
public RepositoryProvider(IRepositoryFactory repositoryFactories, ActivityServiceDbContext context) { _repositoryFactory = repositoryFactories; Repositories = new Dictionary <Type, object>(); DbContext = context; }
public DbInitializer(ActivityServiceDbContext context) { this._context = context; }