Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs =================================================================== diff -u -r0fc840682ffcce4fc1074e7d6687e90cab58bd2b -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs (.../HeightStructuresCalculationService.cs) (revision 0fc840682ffcce4fc1074e7d6687e90cab58bd2b) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationService.cs (.../HeightStructuresCalculationService.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -137,7 +137,7 @@ else { log.ErrorFormat(Resources.HeightStructuresCalculationService_Calculate_Error_in_height_structures_0_calculation_click_details_for_last_error_1, - calculationName, lastErrorContent); + calculationName, lastErrorContent); } exceptionThrown = true; Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs =================================================================== diff -u -r39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5 -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 39dd0f7ebd4f9f1069e8e0b357844b8005b26bc5) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -82,6 +82,36 @@ AssertHeightStructure(structure, input); } + #region Schematization + + [Test] + public void LevelCrestStructure_Always_ExpectedValues() + { + // Setup + var random = new Random(22); + var input = new HeightStructuresInput(); + var mean = (RoundedDouble) (0.01 + random.NextDouble()); + var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); + var expectedDistribution = new NormalDistribution(2) + { + Mean = mean, + StandardDeviation = standardDeviation + }; + var distributionToSet = new NormalDistribution(5) + { + Mean = mean, + StandardDeviation = standardDeviation + }; + + // Call + input.LevelCrestStructure = distributionToSet; + + // Assert + AssertDistributionCorrectlySet(input.LevelCrestStructure, distributionToSet, expectedDistribution); + } + + #endregion + #region Hydraulic data [Test] @@ -97,7 +127,7 @@ var input = new HeightStructuresInput(); // Call - TestDelegate call = () => input.DeviationWaveDirection = (RoundedDouble)invalidValue; + TestDelegate call = () => input.DeviationWaveDirection = (RoundedDouble) invalidValue; // Assert const string expectedMessage = "De waarde voor de afwijking van de golfrichting moet in het bereik [-360, 360] liggen."; @@ -126,36 +156,6 @@ #endregion - #region Schematization - - [Test] - public void LevelCrestStructure_Always_ExpectedValues() - { - // Setup - var random = new Random(22); - var input = new HeightStructuresInput(); - var mean = (RoundedDouble) (0.01 + random.NextDouble()); - var standardDeviation = (RoundedDouble) (0.01 + random.NextDouble()); - var expectedDistribution = new NormalDistribution(2) - { - Mean = mean, - StandardDeviation = standardDeviation - }; - var distributionToSet = new NormalDistribution(5) - { - Mean = mean, - StandardDeviation = standardDeviation - }; - - // Call - input.LevelCrestStructure = distributionToSet; - - // Assert - AssertDistributionCorrectlySet(input.LevelCrestStructure, distributionToSet, expectedDistribution); - } - - #endregion - #region Helpers private static void AssertHeightStructure(HeightStructure expectedHeightStructure, HeightStructuresInput input) Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -r5c5df51bc14a7e25692abf1db5a7476e5036b13f -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs (.../HeightStructuresFailureMechanismPropertiesTest.cs) (revision 5c5df51bc14a7e25692abf1db5a7476e5036b13f) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresFailureMechanismPropertiesTest.cs (.../HeightStructuresFailureMechanismPropertiesTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -26,7 +26,6 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.HeightStructures.Data; -using Ringtoets.HeightStructures.Data.Properties; using Ringtoets.HeightStructures.Forms.PropertyClasses; namespace Ringtoets.HeightStructures.Forms.Test.PropertyClasses Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs =================================================================== diff -u -rab20c4eb4ca81bd3845d50210d2bdb301177af6a -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs (.../HeightStructuresScenariosViewTest.cs) (revision ab20c4eb4ca81bd3845d50210d2bdb301177af6a) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs (.../HeightStructuresScenariosViewTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -250,8 +250,8 @@ view.Data = failureMechanism.CalculationsGroup; view.FailureMechanism = failureMechanism; - var calculationA = (StructuresCalculation)failureMechanism.CalculationsGroup.Children[0]; - var calculationB = (StructuresCalculation)failureMechanism.CalculationsGroup.Children[1]; + var calculationA = (StructuresCalculation) failureMechanism.CalculationsGroup.Children[0]; + var calculationB = (StructuresCalculation) failureMechanism.CalculationsGroup.Children[1]; calculationA.InputParameters.Structure = calculationB.InputParameters.Structure; @@ -285,7 +285,7 @@ view.Data = failureMechanism.CalculationsGroup; view.FailureMechanism = failureMechanism; - var calculationB = ((StructuresCalculation)failureMechanism.CalculationsGroup.Children[1]); + var calculationB = ((StructuresCalculation) failureMechanism.CalculationsGroup.Children[1]); var calculationC = new StructuresCalculation { Name = "CalculationC" Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u -rdf13dff5aedb149d7b566bed9dda68fe9e3a8e02 -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision df13dff5aedb149d7b566bed9dda68fe9e3a8e02) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (.../HeightStructuresCalculationActivityIntegrationTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -215,7 +215,7 @@ var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; calculator.EndInFailure = true; // Call @@ -230,7 +230,7 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith(string.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt. Er is geen foutrapport beschikbaar.", - calculation.Name), msgs[3]); + calculation.Name), msgs[3]); StringAssert.StartsWith("Hoogte kunstwerk berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); }); @@ -269,7 +269,7 @@ var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; calculator.EndInFailure = false; calculator.LastErrorContent = "An error occured"; @@ -285,7 +285,7 @@ StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); StringAssert.StartsWith(string.Format("De berekening voor hoogte kunstwerk '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", - calculation.Name), msgs[3]); + calculation.Name), msgs[3]); StringAssert.StartsWith("Hoogte kunstwerk berekening is uitgevoerd op de tijdelijke locatie:", msgs[4]); StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[5]); }); @@ -332,9 +332,9 @@ using (new HydraRingCalculatorFactoryConfig()) { - activity.Run(); + activity.Run(); } - + // Call activity.Finish(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs =================================================================== diff -u -rab20c4eb4ca81bd3845d50210d2bdb301177af6a -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs (.../HeightStructuresScenariosViewIntegrationTest.cs) (revision ab20c4eb4ca81bd3845d50210d2bdb301177af6a) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs (.../HeightStructuresScenariosViewIntegrationTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -89,7 +89,7 @@ new HeightStructuresImporter(assessmentSection.HeightStructures.HeightStructures, assessmentSection.ReferenceLine, filePath) - .Import(); + .Import(); CalculationGroup calculationsGroup = assessmentSection.HeightStructures.CalculationsGroup; var view = new HeightStructuresScenariosView @@ -102,7 +102,6 @@ var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - // Call foreach (var structure in assessmentSection.HeightStructures.HeightStructures) { @@ -121,7 +120,7 @@ DataGridViewCell dataGridViewCell = dataGridView.Rows[13].Cells[1]; Assert.AreEqual(2, ((DataGridViewComboBoxCell) dataGridViewCell).Items.Count); Assert.AreEqual("", ((DataGridViewComboBoxCell) dataGridViewCell).Items[0].ToString()); - Assert.AreEqual("Eerste kunstwerk 6-3", ((DataGridViewComboBoxCell)dataGridViewCell).Items[1].ToString()); + Assert.AreEqual("Eerste kunstwerk 6-3", ((DataGridViewComboBoxCell) dataGridViewCell).Items[1].ToString()); } } @@ -137,7 +136,7 @@ new HeightStructuresImporter(assessmentSection.HeightStructures.HeightStructures, assessmentSection.ReferenceLine, filePath) - .Import(); + .Import(); CalculationGroup calculationsGroup = assessmentSection.HeightStructures.CalculationsGroup; var view = new HeightStructuresScenariosView @@ -150,7 +149,6 @@ var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - foreach (var structure in assessmentSection.HeightStructures.HeightStructures) { calculationsGroup.Children.Add(new StructuresCalculation @@ -167,15 +165,15 @@ // Call foreach (var calculationBase in calculationsGroup.Children) { - var calculation = (StructuresCalculation)calculationBase; + var calculation = (StructuresCalculation) calculationBase; calculation.Name += "_changed"; } // Assert DataGridViewCell dataGridViewCell = dataGridView.Rows[13].Cells[1]; Assert.AreEqual(2, ((DataGridViewComboBoxCell) dataGridViewCell).Items.Count); Assert.AreEqual("", ((DataGridViewComboBoxCell) dataGridViewCell).Items[0].ToString()); - Assert.AreEqual("Eerste kunstwerk 6-3_changed", ((DataGridViewComboBoxCell)dataGridViewCell).Items[1].ToString()); + Assert.AreEqual("Eerste kunstwerk 6-3_changed", ((DataGridViewComboBoxCell) dataGridViewCell).Items[1].ToString()); } } @@ -191,7 +189,7 @@ new HeightStructuresImporter(assessmentSection.HeightStructures.HeightStructures, assessmentSection.ReferenceLine, filePath) - .Import(); + .Import(); var view = new HeightStructuresScenariosView { @@ -217,15 +215,15 @@ // Call var calculationsGroup = assessmentSection.HeightStructures.CalculationsGroup; - ((StructuresCalculation)calculationsGroup.Children[1]).InputParameters.Structure = - ((StructuresCalculation)calculationsGroup.Children[0]).InputParameters.Structure; + ((StructuresCalculation) calculationsGroup.Children[1]).InputParameters.Structure = + ((StructuresCalculation) calculationsGroup.Children[0]).InputParameters.Structure; calculationsGroup.NotifyObservers(); // Assert DataGridViewCell dataGridViewCell = dataGridView.Rows[13].Cells[1]; Assert.AreEqual(3, ((DataGridViewComboBoxCell) dataGridViewCell).Items.Count); Assert.AreEqual("", ((DataGridViewComboBoxCell) dataGridViewCell).Items[0].ToString()); - Assert.AreEqual("Eerste kunstwerk 6-3Calculation", ((DataGridViewComboBoxCell)dataGridViewCell).Items[1].ToString()); + Assert.AreEqual("Eerste kunstwerk 6-3Calculation", ((DataGridViewComboBoxCell) dataGridViewCell).Items[1].ToString()); Assert.AreEqual("Tweede kunstwerk 6-3Calculation", ((DataGridViewComboBoxCell) dataGridViewCell).Items[2].ToString()); DataGridViewCell dataGridViewCellWithRemovedCalculation = dataGridView.Rows[56].Cells[1]; Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ImportInfos/HeightStructuresContextImportInfoTest.cs =================================================================== diff -u -rdd72cf407b7d0e9284d101bb2e2854e569b1a29a -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ImportInfos/HeightStructuresContextImportInfoTest.cs (.../HeightStructuresContextImportInfoTest.cs) (revision dd72cf407b7d0e9284d101bb2e2854e569b1a29a) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ImportInfos/HeightStructuresContextImportInfoTest.cs (.../HeightStructuresContextImportInfoTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -184,6 +184,6 @@ private static ImportInfo GetImportInfo(HeightStructuresPlugin plugin) { return plugin.GetImportInfos().First(ii => ii.DataType == typeof(HeightStructuresContext)); - } + } } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationServiceTest.cs =================================================================== diff -u -r1d64c85fa6d013812d3f38fa09ae4e7ec82480fe -r636633d6507bef2735fd9b712b3a20feb3ac88c4 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationServiceTest.cs (.../HeightStructuresCalculationServiceTest.cs) (revision 1d64c85fa6d013812d3f38fa09ae4e7ec82480fe) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationServiceTest.cs (.../HeightStructuresCalculationServiceTest.cs) (revision 636633d6507bef2735fd9b712b3a20feb3ac88c4) @@ -869,7 +869,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; calculator.LastErrorContent = "An error occured"; calculator.EndInFailure = true; @@ -881,9 +881,9 @@ try { new HeightStructuresCalculationService().Calculate(calculation, - assessmentSectionStub, - failureMechanism, - testDataPath); + assessmentSectionStub, + failureMechanism, + testDataPath); } catch (HydraRingFileParserException) { @@ -931,7 +931,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; calculator.EndInFailure = true; var exceptionThrown = false; @@ -942,9 +942,9 @@ try { new HeightStructuresCalculationService().Calculate(calculation, - assessmentSectionStub, - failureMechanism, - testDataPath); + assessmentSectionStub, + failureMechanism, + testDataPath); } catch (HydraRingFileParserException) { @@ -992,7 +992,7 @@ using (new HydraRingCalculatorFactoryConfig()) { - var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; + var calculator = ((TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance).StructuresOvertoppingCalculator; calculator.EndInFailure = false; calculator.LastErrorContent = "An error occured"; @@ -1005,9 +1005,9 @@ try { new HeightStructuresCalculationService().Calculate(calculation, - assessmentSectionStub, - failureMechanism, - testDataPath); + assessmentSectionStub, + failureMechanism, + testDataPath); } catch (HydraRingFileParserException e) {