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