private IEnumerable <OrderedDictionary> GetPreprocessorSettingsConfiguration() { var orderedDictionaries = new List <OrderedDictionary>(); foreach (HydraRingCalculationInput hydraRingCalculationInput in hydraRingInputs) { PreprocessorSetting preprocessorSetting = hydraRingCalculationInput.PreprocessorSetting; if (preprocessorSetting.RunPreprocessor) { orderedDictionaries.Add(new OrderedDictionary { { "SectionId", hydraRingCalculationInput.Section.SectionId }, { "MinValueRunPreprocessor", preprocessorSetting.ValueMin }, { "MaxValueRunPreprocessor", preprocessorSetting.ValueMax } }); } } return(orderedDictionaries); }
public void GetPreprocessorSetting_UsePreprocessorTrueAndKnownLocationId_ReturnsExpectedPreprocessorSetting() { // Setup using (var provider = new PreprocessorSettingsProvider(completeDatabaseDataPath)) { // Call PreprocessorSetting setting = provider.GetPreprocessorSetting(700131, true); // Assert Assert.IsTrue(setting.RunPreprocessor); Assert.AreEqual(2, setting.ValueMin); Assert.AreEqual(8, setting.ValueMax); NumericsSetting numericsSetting = setting.NumericsSetting; Assert.AreEqual(2, numericsSetting.CalculationTechniqueId); Assert.AreEqual(3, numericsSetting.FormStartMethod); Assert.AreEqual(20, numericsSetting.FormNumberOfIterations); Assert.AreEqual(0.2, numericsSetting.FormRelaxationFactor); Assert.AreEqual(0.1, numericsSetting.FormEpsBeta); Assert.AreEqual(0.1, numericsSetting.FormEpsHoh); Assert.AreEqual(0.1, numericsSetting.FormEpsZFunc); Assert.AreEqual(3, numericsSetting.DsStartMethod); Assert.AreEqual(4, numericsSetting.DsMinNumberOfIterations); Assert.AreEqual(15000, numericsSetting.DsMaxNumberOfIterations); Assert.AreEqual(90000, numericsSetting.DsVarCoefficient); Assert.AreEqual(0.2, numericsSetting.NiUMin); Assert.AreEqual(-4, numericsSetting.NiUMax); Assert.AreEqual(5, numericsSetting.NiNumberSteps); } }
public void ParameterlessConstructor_ExpectedValues() { // Call var preprocessorSetting = new PreprocessorSetting(); // Assert Assert.IsFalse(preprocessorSetting.RunPreprocessor); Assert.IsNaN(preprocessorSetting.ValueMin); Assert.IsNaN(preprocessorSetting.ValueMax); Assert.IsNull(preprocessorSetting.NumericsSetting); }
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); }
public void GetPreprocessorSetting_UsePreprocessorTrueLocationIdExcluded_ReturnsExpectedPreprocessorSetting() { // Setup using (var provider = new PreprocessorSettingsProvider(completeDatabaseDataPath)) { // Call PreprocessorSetting setting = provider.GetPreprocessorSetting(700136, true); // Assert Assert.IsFalse(setting.RunPreprocessor); } }
public void ParameteredConstructor_ExpectedValues() { // Setup var random = new Random(21); double valueMin = random.NextDouble(); double valueMax = random.NextDouble(); var numericsSetting = new NumericsSetting(1, 4, 50, 0.15, 0.05, 0.01, 0.01, 0, 2, 20000, 100000, 0.1, -6, 6); // Call var preprocessorSetting = new PreprocessorSetting(valueMin, valueMax, numericsSetting); // Assert Assert.IsTrue(preprocessorSetting.RunPreprocessor); Assert.AreEqual(valueMin, preprocessorSetting.ValueMin); Assert.AreEqual(valueMax, preprocessorSetting.ValueMax); Assert.AreSame(numericsSetting, preprocessorSetting.NumericsSetting); }