/// <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"); }
/// <summary> /// Purges all custom material props. /// </summary> public void Dispose() { DatabasePurger.PurgeCustomMaterialProps(); }
/// <summary> /// Purges all tables used in these tests. /// </summary> /// <exception cref="NotImplementedException"></exception> public void Dispose() { DatabasePurger.PurgeMaterials(); DatabasePurger.PurgePlastics(); DatabasePurger.PurgeCustomMaterialProps(); }
/// <summary> /// Sets up needed repositories and purges all related tables. /// </summary> public CustomMaterialPropRepositoryTests() { Repository = new PostgreSqlCustomMaterialPropRepository(ConfigurationProvider.GetConfiguration()); DatabasePurger.PurgeCustomMaterialProps(); }