public void Initialize() { Data = new List <UrbanizationByState> { urbStateOne, urbStateTwo, urbStateThree }; _DbContext = MockDbContextFactory.CreateMockDbContext(Data); _UrbStateStore = new UrbanizationByStateStore(_DbContext); }
public void Initialize() { Data = new List <UrbanizationByState> { urbStateOne, urbStateTwo, urbStateThree }; _ServiceCollection = new ServiceCollection(); _ServiceCollection.AddSingleton(MockDbContextFactory.CreateMockDbContext(Data)); _ServiceCollection.AddSingleton <IUrbanizationByStateStore, UrbanizationByStateStore>(); _ServiceCollection.AddSingleton <IUrbanizationByStateService, UrbanizationByStateService>(); _UrbStateService = _ServiceCollection.BuildServiceProvider().GetRequiredService <IUrbanizationByStateService>(); }
protected override void Load(ContainerBuilder builder) { base.Load(builder); IOptions <DataLayerOptions> opts = Options.Create(new DataLayerOptions { ConnectionString = Db.ApplicationConnectionString }); var factory = new MockDbContextFactory(opts, TestLogger.Factory); builder.RegisterInstance(factory).As <IDbContextFactory>(); }
public void TestCleanup() { MockRepositoryProvider.VerifyAll(); MockDbContextFactory.VerifyAll(); MockDbContext.VerifyAll(); }