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