Ejemplo n.º 1
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.º 2
0
 /// <summary>
 /// Purges all custom material props.
 /// </summary>
 public void Dispose()
 {
     DatabasePurger.PurgeCustomMaterialProps();
 }
Ejemplo n.º 3
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.º 4
0
 /// <summary>
 /// Sets up needed repositories and purges all related tables.
 /// </summary>
 public CustomMaterialPropRepositoryTests()
 {
     Repository = new PostgreSqlCustomMaterialPropRepository(ConfigurationProvider.GetConfiguration());
     DatabasePurger.PurgeCustomMaterialProps();
 }