예제 #1
0
        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);
        }
예제 #2
0
 public RepositoryProvider(IRepositoryFactory repositoryFactories, ActivityServiceDbContext context)
 {
     _repositoryFactory = repositoryFactories;
     Repositories       = new Dictionary <Type, object>();
     DbContext          = context;
 }
예제 #3
0
 public DbInitializer(ActivityServiceDbContext context)
 {
     this._context = context;
 }