Exemplo n.º 1
0
        public void Constructor_ExpectedValues()
        {
            // Call
            var designTablesSetting = new DesignTablesSetting(1.1, 2.2);

            // Assert
            Assert.AreEqual(1.1, designTablesSetting.ValueMin);
            Assert.AreEqual(2.2, designTablesSetting.ValueMax);
        }
Exemplo n.º 2
0
        private IEnumerable <OrderedDictionary> GetDesignTablesConfiguration()
        {
            var orderedDictionaries = new List <OrderedDictionary>();

            foreach (HydraRingCalculationInput hydraRingCalculationInput in hydraRingInputs)
            {
                FailureMechanismDefaults failureMechanismDefaults = failureMechanismDefaultsProvider.GetFailureMechanismDefaults(hydraRingCalculationInput.FailureMechanismType);
                DesignTablesSetting      designTablesSetting      = hydraRingCalculationInput.DesignTablesSetting;

                orderedDictionaries.Add(new OrderedDictionary
                {
                    {
                        "SectionId", hydraRingCalculationInput.Section.SectionId
                    },
                    {
                        "MechanismId", failureMechanismDefaults.MechanismId
                    },
                    {
                        "LayerId", defaultLayerId // Fixed: no support for revetments
                    },
                    {
                        "AlternativeId", defaultAlternativeId // Fixed: no support for piping
                    },
                    {
                        "Method", hydraRingCalculationInput.CalculationTypeId
                    },
                    {
                        "VariableId", hydraRingCalculationInput.VariableId
                    },
                    {
                        "LoadVariableId", defaultHydraRingValue // Fixed: not relevant
                    },
                    {
                        "TableMin", defaultHydraRingValue // Fixed: no support for type III calculations (see "Method")
                    },
                    {
                        "TableMax", defaultHydraRingValue // Fixed: no support for type III calculations (see "Method")
                    },
                    {
                        "TableStepSize", defaultHydraRingValue // Fixed: no support for type III calculations (see "Method")
                    },
                    {
                        "ValueMin", GetHydraRingValue(designTablesSetting.ValueMin)
                    },
                    {
                        "ValueMax", GetHydraRingValue(designTablesSetting.ValueMax)
                    },
                    {
                        "Beta", GetHydraRingValue(hydraRingCalculationInput.Beta)
                    }
                });
            }

            return(orderedDictionaries);
        }
Exemplo n.º 3
0
        public void ReadDesignTableSetting_EmptyTable_ReturnNull()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(emptyDatabasePath))
            {
                // Call
                DesignTablesSetting setting = reader.ReadDesignTableSetting(700131, 0);

                // Assert
                Assert.IsNull(setting);
            }
        }
Exemplo n.º 4
0
        public void ReadDesignTableSetting_ValidLocationIdAndFailureMechanismTypeNotInDatabase_ReturnNull(long locationId, HydraRingFailureMechanismType calculationType)
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                DesignTablesSetting setting = reader.ReadDesignTableSetting(locationId, calculationType);

                // Assert
                Assert.IsNull(setting);
            }
        }
Exemplo n.º 5
0
 public TestHydraRingCalculationInput() : base(12)
 {
     PreprocessorSetting = new PreprocessorSetting();
     DesignTablesSetting = new DesignTablesSetting(0, 0);
     NumericsSettings    = new Dictionary <int, NumericsSetting>
     {
         {
             1, new NumericsSetting(11, 4, 150, 0.15, 0.005, 0.005, 0.005, 2, 10000, 40000, 0.1, -6.0, 6.0, 25)
         }
     };
     TimeIntegrationSetting = new TimeIntegrationSetting(1);
 }
Exemplo n.º 6
0
        public void GetDesignTablesSetting_UnknownFailureMechanismTypeOrLocationId_ReturnsDefaultDesignTablesSetting(
            HydraRingFailureMechanismType failureMechanismType, long locationId, double expectedValueMin, double expectedValueMax)
        {
            // Setup
            using (var designTablesSettingsProvider = new DesignTablesSettingsProvider(completeDatabaseDataPath))
            {
                // Call
                DesignTablesSetting designTablesSetting = designTablesSettingsProvider.GetDesignTablesSetting(locationId, failureMechanismType);

                // Assert
                Assert.AreEqual(expectedValueMin, designTablesSetting.ValueMin);
                Assert.AreEqual(expectedValueMax, designTablesSetting.ValueMax);
            }
        }
Exemplo n.º 7
0
        public void ReadDesignTableSetting_ValidLocationIdAndFailureMechanismType_DesignTableSettingWithExpectedValues(
            long locationId, HydraRingFailureMechanismType calculationType, double expectedMin, double expectedMax)
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                DesignTablesSetting setting = reader.ReadDesignTableSetting(locationId, calculationType);

                // Assert
                Assert.AreEqual(expectedMin, setting.ValueMin);
                Assert.AreEqual(expectedMax, setting.ValueMax);
            }
        }