Example #1
0
 public void CleanUp()
 {
     using (var context = new GarageAdministratieContext(_options))
     {
         context.Database.EnsureDeleted();
     }
 }
Example #2
0
 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);
     }
 }
Example #3
0
        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();
            }
        }
Example #4
0
        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();
        }