/// <summary>
 /// Purges all tables used in these tests.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeBatches();
     DatabasePurger.PurgeCustomBatchProps();
     DatabasePurger.PurgeLocations();
     DatabasePurger.PurgeMaterials();
     DatabasePurger.PurgePlastics();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Purges all tables used in these tests.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeTransactions();
     DatabasePurger.PurgeBatches();
     DatabasePurger.PurgeLocations();
     DatabasePurger.PurgeMaterials();
     DatabasePurger.PurgePlastics();
     DatabasePurger.PurgeUsers();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets up needed repositories and purges all related tables.
        /// </summary>
        public MaterialsRepositoryTests()
        {
            // Repos
            IConfiguration configuration = ConfigurationProvider.GetConfiguration();

            Repository          = new PostgreSqlMaterialsRepository(configuration);
            PropRepository      = new PostgreSqlCustomMaterialPropRepository(configuration);
            PropValueRepository = new PostgreSqlCustomMaterialPropValueRepository(configuration);
            IPlasticsRepository plasticsRepository = new PostgreSqlPlasticsRepository(configuration);

            // Purge for blank slate
            DatabasePurger.PurgeMaterials();
            DatabasePurger.PurgePlastics();
            DatabasePurger.PurgeCustomMaterialProps();

            // Create plastics
            PC = plasticsRepository.CreatePlastic("PC", "Polycarbonate");
            PE = plasticsRepository.CreatePlastic("PE", "Polyethylene");
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Purges
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgePlastics();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Sets up the SUT and needed services and and cleans up plastics tbales.
 /// </summary>
 public PlasticsRepositoryTests()
 {
     Repository = new PostgreSqlPlasticsRepository(ConfigurationProvider.GetConfiguration());
     DatabasePurger.PurgePlastics();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Sets up the SUT and needed services, and cleans up the users table.
 /// </summary>
 public UserRepositoryTests()
 {
     Repository             = new PostgreSqlUserRepository(ConfigurationProvider.GetConfiguration());
     PasswordHashingService = new PasswordHashingService(new LoggerFactory());
     DatabasePurger.PurgeUsers();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Cleans up the users table!
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeUsers();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Purges custom batch props.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeCustomBatchProps();
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Resets the OpenMTS configuration to default values.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.ResetConfiguration();
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Sets up the SUT and needed services and and cleans up API key tbales.
 /// </summary>
 public ApiKeyRepositoryTests()
 {
     Repository    = new PostgreSqlApiKeyRepository(ConfigurationProvider.GetConfiguration());
     RightsService = new RightsService(new LoggerFactory(), new MemoryRightsRepository());
     DatabasePurger.PurgeApiKeys();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Purges API key tables.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeApiKeys();
 }
 /// <summary>
 /// Sets up the SUT and needed services and and cleans up locations tbales.
 /// </summary>
 public LocationsRepositoryTests()
 {
     Repository = new PostgreSqlLocationsRepository(ConfigurationProvider.GetConfiguration());
     DatabasePurger.PurgeLocations();
 }
 /// <summary>
 /// Pruges all locations.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeLocations();
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Purges all custom material props.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeCustomMaterialProps();
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Purges all tables used in these tests.
 /// </summary>
 /// <exception cref="NotImplementedException"></exception>
 public void Dispose()
 {
     DatabasePurger.PurgeMaterials();
     DatabasePurger.PurgePlastics();
     DatabasePurger.PurgeCustomMaterialProps();
 }
Ejemplo n.º 16
0
 /// <summary>
 /// Sets up all needed repositories and purges related tables.
 /// </summary>
 public CustomBatchPropRepositoryTests()
 {
     Repository = new PostgreSqlCustomBatchPropRepository(ConfigurationProvider.GetConfiguration());
     DatabasePurger.PurgeCustomBatchProps();
 }
Ejemplo n.º 17
0
 /// <summary>
 /// Sets up the SUT and resets configuration.
 /// </summary>
 public ConfigurationRepositoryTests()
 {
     Repository = new PostgreSqlConfigurationRepository(ConfigurationProvider.GetConfiguration());
     DatabasePurger.ResetConfiguration();
 }