public void CleanUp() { using (var context = new GarageAdministratieContext(_options)) { context.Database.EnsureDeleted(); } }
private void InsertOrUpdateOnderhoudsopdracht(Onderhoudsopdracht onderhoudsOpdracht) { try { using (var context = new GarageAdministratieContext(_options)) using (var repository = new OnderhoudsopdrachtenRepository(context)) { if (repository.Exists(onderhoudsOpdracht.OnderhoudsId)) { Debug.WriteLine("Updating"); repository.Update(onderhoudsOpdracht); } else { Debug.WriteLine("Inserting"); repository.Insert(onderhoudsOpdracht); } } } catch (Exception e) { Debug.WriteLine(e.Message); Debug.WriteLine(e.StackTrace); } }
public void Init() { // Use InMemory database for testing, records are not removed afterwards from Local Database //_options = TestDatabaseProvider.CreateInMemoryDatabaseOptions(); _options = TestDatabaseProvider.CreateMsSQLDatabaseOptions(); // Act using (var context = new GarageAdministratieContext(_options, true)) { context.Database.EnsureDeleted(); } }
public void Init() { // Use InMemory database for testing, records are not removed afterwards from Local Database //_options = TestDatabaseProvider.CreateInMemoryDatabaseOptions(); _options = TestDatabaseProvider.CreateMsSQLDatabaseOptions(); using (var context = new GarageAdministratieContext(_options, true)) { } _rdwIntegrationServiceAgent = new RdwIntegrationServiceAgentMock(); _rdwIntegrationServiceExceptionAgent = new RdwIntegrationServiceExceptionAgent(); }