Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs =================================================================== diff -u -r2ab89f4256cd77d3386c27ca1cbd49a16f4abba2 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision 2ab89f4256cd77d3386c27ca1cbd49a16f4abba2) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -78,7 +78,9 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new MacroStabilityInwardsInputContextProperties(null, GetTestNormativeAssessmentLevel, handler); + TestDelegate test = () => new MacroStabilityInwardsInputContextProperties(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert var exception = Assert.Throws(test); @@ -133,7 +135,9 @@ assessmentSection); // Call - TestDelegate test = () => new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, null); + TestDelegate test = () => new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + null); // Assert var exception = Assert.Throws(test); @@ -160,7 +164,9 @@ assessmentSection); // Call - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert Assert.IsInstanceOf>(properties); @@ -190,7 +196,9 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); // Call - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler) + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler) { UseAssessmentLevelManualInput = false }; @@ -333,7 +341,9 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); // Call - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler) + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler) { UseAssessmentLevelManualInput = useManualAssessmentLevelInput }; @@ -432,12 +442,14 @@ assessmentSection); // Call - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert RoundedDouble expectedAssessmentLevel = useManualAssessmentLevelInput ? inputParameters.AssessmentLevel - : GetTestNormativeAssessmentLevel(); + : AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); Assert.AreEqual(expectedAssessmentLevel, properties.AssessmentLevel); Assert.AreSame(hydraulicBoundaryLocation, properties.SelectedHydraulicBoundaryLocation.HydraulicBoundaryLocation); Assert.AreEqual(inputParameters.UseAssessmentLevelManualInput, properties.UseAssessmentLevelManualInput); @@ -491,7 +503,9 @@ assessmentSection); var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var random = new Random(21); const double assessmentLevel = 0.36; @@ -666,7 +680,9 @@ var handler = new SetPropertyValueAfterConfirmationParameterTester(new IObservable[0]); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile); @@ -720,7 +736,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call properties.SurfaceLine = testSurfaceLine; @@ -774,7 +792,9 @@ var handler = new SetPropertyValueAfterConfirmationParameterTester(new IObservable[0]); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call properties.SurfaceLine = newSurfaceLine; @@ -839,7 +859,9 @@ observable }); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call properties.StochasticSoilModel = stochasticSoilModel2; @@ -863,7 +885,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable surfaceLines = properties.GetAvailableSurfaceLines(); @@ -887,7 +911,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition: Assert.IsNull(calculation.InputParameters.SurfaceLine); @@ -957,7 +983,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition: Assert.IsNotNull(calculation.InputParameters.SurfaceLine); @@ -988,7 +1016,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition Assert.IsNull(calculation.InputParameters.StochasticSoilModel); @@ -1027,7 +1057,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition Assert.IsNotNull(calculation.InputParameters.StochasticSoilModel); @@ -1054,7 +1086,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = null; @@ -1104,7 +1138,9 @@ failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // When IEnumerable availableHydraulicBoundaryLocations = @@ -1146,7 +1182,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable selectableHydraulicBoundaryLocations = @@ -1198,7 +1236,9 @@ var context = new MacroStabilityInwardsInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable selectableHydraulicBoundaryLocations = @@ -1263,7 +1303,9 @@ observable }); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); IEnumerable originalList = properties.GetSelectableHydraulicBoundaryLocations() .ToList(); @@ -1313,7 +1355,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicReadOnlyValidationMethod("AssessmentLevel"); @@ -1340,7 +1384,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicReadOnlyValidationMethod("prop"); @@ -1376,7 +1422,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicVisibleValidationMethod("SelectedHydraulicBoundaryLocation"); @@ -1403,7 +1451,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicVisibleValidationMethod("prop"); @@ -1439,7 +1489,9 @@ observable }); - var properties = new MacroStabilityInwardsInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call setProperty(properties); @@ -1449,11 +1501,6 @@ mocks.VerifyAll(); } - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } - private static MacroStabilityInwardsStochasticSoilModel ValidStochasticSoilModel(double xMin, double xMax) { MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressLinesPropertiesTest.cs =================================================================== diff -u -r495362773d29e219c1b356b726fb9d2df5772775 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressLinesPropertiesTest.cs (.../MacroStabilityInwardsWaterStressLinesPropertiesTest.cs) (revision 495362773d29e219c1b356b726fb9d2df5772775) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressLinesPropertiesTest.cs (.../MacroStabilityInwardsWaterStressLinesPropertiesTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -43,7 +43,8 @@ public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsWaterStressLinesProperties(null, GetTestNormativeAssessmentLevel()); + TestDelegate test = () => new MacroStabilityInwardsWaterStressLinesProperties(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert var exception = Assert.Throws(test); @@ -57,7 +58,8 @@ var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, GetTestNormativeAssessmentLevel()); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert Assert.IsInstanceOf>(properties); @@ -96,7 +98,8 @@ // Setup MacroStabilityInwardsCalculationScenario calculation = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenarioWithValidInput(new TestHydraulicBoundaryLocation()); - var properties = new MacroStabilityInwardsWaterStressLinesProperties(calculation.InputParameters, GetTestNormativeAssessmentLevel()); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(calculation.InputParameters, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); using (new MacroStabilityInwardsCalculatorFactoryConfig()) { @@ -115,7 +118,8 @@ { // Setup var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, GetTestNormativeAssessmentLevel()); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Call string name = properties.ToString(); @@ -131,7 +135,8 @@ var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, GetTestNormativeAssessmentLevel()); + var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -154,10 +159,5 @@ "Eigenschappen van de waterspanningslijnen bij dagelijkse omstandigheden.", true); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressesPropertiesTest.cs =================================================================== diff -u -r495362773d29e219c1b356b726fb9d2df5772775 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressesPropertiesTest.cs (.../MacroStabilityInwardsWaterStressesPropertiesTest.cs) (revision 495362773d29e219c1b356b726fb9d2df5772775) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsWaterStressesPropertiesTest.cs (.../MacroStabilityInwardsWaterStressesPropertiesTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -70,7 +70,9 @@ var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaterStressesProperties(input, GetTestNormativeAssessmentLevel(), propertyChangeHandler); + var properties = new MacroStabilityInwardsWaterStressesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + propertyChangeHandler); // Assert Assert.IsInstanceOf>(properties); @@ -97,7 +99,9 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => new MacroStabilityInwardsWaterStressesProperties(null, GetTestNormativeAssessmentLevel(), propertyChangeHandler); + TestDelegate call = () => new MacroStabilityInwardsWaterStressesProperties(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + propertyChangeHandler); // Assert var exception = Assert.Throws(call); @@ -112,7 +116,9 @@ var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - TestDelegate call = () => new MacroStabilityInwardsWaterStressesProperties(input, GetTestNormativeAssessmentLevel(), null); + TestDelegate call = () => new MacroStabilityInwardsWaterStressesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + null); // Assert var exception = Assert.Throws(call); @@ -130,7 +136,9 @@ var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - var properties = new MacroStabilityInwardsWaterStressesProperties(input, GetTestNormativeAssessmentLevel(), propertyChangeHandler); + var properties = new MacroStabilityInwardsWaterStressesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + propertyChangeHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -297,7 +305,9 @@ MacroStabilityInwardsInput input = calculationItem.InputParameters; var propertyChangeHandler = new ObservablePropertyChangeHandler(calculationItem, input); - var properties = new MacroStabilityInwardsWaterStressesProperties(input, GetTestNormativeAssessmentLevel(), propertyChangeHandler); + var properties = new MacroStabilityInwardsWaterStressesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + propertyChangeHandler); var random = new Random(21); double waterLevelRiverAverage = random.NextDouble(); @@ -454,7 +464,9 @@ mocks.ReplayAll(); var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); - var properties = new MacroStabilityInwardsWaterStressesProperties(input, GetTestNormativeAssessmentLevel(), propertyChangeHandler); + var properties = new MacroStabilityInwardsWaterStressesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + propertyChangeHandler); // Call string toString = properties.ToString(); @@ -463,11 +475,6 @@ Assert.AreEqual(string.Empty, toString); } - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } - private static void SetPropertyAndVerifyNotificationsForCalculation(Action setProperty, MacroStabilityInwardsCalculation calculation) { @@ -484,7 +491,9 @@ observable }); - var properties = new MacroStabilityInwardsWaterStressesProperties(input, GetTestNormativeAssessmentLevel(), propertyChangeHandler); + var properties = new MacroStabilityInwardsWaterStressesProperties(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel(), + propertyChangeHandler); // Call setProperty(properties); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs =================================================================== diff -u -r2f0f4e0bd2be4afb1e2b8f5b2380c6a8abea8ad3 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs) (revision 2f0f4e0bd2be4afb1e2b8f5b2380c6a8abea8ad3) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -23,12 +23,12 @@ using System.ComponentModel; using System.Linq; using System.Windows.Forms.Design; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -72,7 +72,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditor(); var someValue = new object(); @@ -141,7 +143,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditor(); var someValue = new object(); @@ -161,10 +165,5 @@ mockRepository.VerifyAll(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs =================================================================== diff -u -r2f0f4e0bd2be4afb1e2b8f5b2380c6a8abea8ad3 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision 2f0f4e0bd2be4afb1e2b8f5b2380c6a8abea8ad3) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -23,12 +23,12 @@ using System.ComponentModel; using System.Linq; using System.Windows.Forms.Design; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -73,7 +73,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditor(); var someValue = new object(); @@ -142,7 +144,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditor(); var someValue = new object(); @@ -162,10 +166,5 @@ mockRepository.VerifyAll(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs =================================================================== diff -u -r2f0f4e0bd2be4afb1e2b8f5b2380c6a8abea8ad3 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs) (revision 2f0f4e0bd2be4afb1e2b8f5b2380c6a8abea8ad3) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextSurfaceLineSelectionEditorTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -23,12 +23,12 @@ using System.ComponentModel; using System.Linq; using System.Windows.Forms.Design; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -70,7 +70,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new MacroStabilityInwardsInputContextSurfaceLineSelectionEditor(); var someValue = new object(); @@ -125,7 +127,9 @@ failureMechanism, assessmentSection); - var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new MacroStabilityInwardsInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new MacroStabilityInwardsInputContextSurfaceLineSelectionEditor(); var someValue = new object(); @@ -146,11 +150,6 @@ mockRepository.VerifyAll(); } - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } - private static MacroStabilityInwardsSurfaceLine ValidSurfaceLine() { var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs =================================================================== diff -u -r6c7a703ee166f8e12f861be7150b359ce9d8a51e -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision 6c7a703ee166f8e12f861be7150b359ce9d8a51e) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsInputViewTest.cs (.../MacroStabilityInwardsInputViewTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -30,6 +30,7 @@ using Core.Components.Chart.Forms; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TestUtil; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -69,7 +70,8 @@ public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsInputView(null, GetTestNormativeAssessmentLevel); + TestDelegate test = () => new MacroStabilityInwardsInputView(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel); // Assert string paramName = Assert.Throws(test).ParamName; @@ -94,7 +96,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); // Call - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert Assert.IsInstanceOf(view); @@ -122,7 +125,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); // Call - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert MacroStabilityInwardsInputViewChartDataAssert.AssertEmptyChartData(view.Chart.Data); @@ -136,7 +140,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); // Call - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert CollectionAssert.IsEmpty(GetSoilLayerTable(view).Rows); @@ -160,7 +165,8 @@ }; // Call - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert MacroStabilityInwardsInputViewChartDataAssert.AssertEmptyWaternetChartData(view.Chart.Data); @@ -185,7 +191,8 @@ // Call using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert ChartData[] chartData = view.Chart.Data.Collection.ToArray(); @@ -216,7 +223,8 @@ }; // Call - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert ChartDataCollection chartData = view.Chart.Data; @@ -255,7 +263,8 @@ Name = initialName }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition Assert.AreEqual(initialName, view.Chart.ChartTitle); @@ -287,7 +296,8 @@ } }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { List chartDataList = view.Chart.Data.Collection.ToList(); var surfaceLineChartData = (ChartLineData) chartDataList[surfaceLineIndex]; @@ -332,7 +342,8 @@ } }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { List chartDataList = view.Chart.Data.Collection.ToList(); var surfaceLineChartData = (ChartDataCollection) chartDataList[soilProfileIndex]; @@ -385,7 +396,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = view.Chart.Data; @@ -492,7 +504,8 @@ // Setup var calculation = new MacroStabilityInwardsCalculationScenario(); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = view.Chart.Data; List chartDataList = chartData.Collection.ToList(); @@ -529,7 +542,8 @@ } }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = view.Chart.Data; List chartDataList = chartData.Collection.ToList(); @@ -590,7 +604,8 @@ } }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { MacroStabilityInwardsSoilLayerDataTable soilLayerDataTable = GetSoilLayerTable(view); @@ -626,7 +641,8 @@ SetGridValues(input.LeftGrid); SetGridValues(input.RightGrid); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition ChartDataCollection chartData = view.Chart.Data; @@ -673,7 +689,8 @@ }; MacroStabilityInwardsInput input = calculation.InputParameters; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition ChartDataCollection chartData = view.Chart.Data; @@ -719,7 +736,8 @@ } }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = view.Chart.Data; @@ -761,7 +779,8 @@ var macroStabilityInwardsCalculatorFactoryConfig = new MacroStabilityInwardsCalculatorFactoryConfig(); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition ChartData[] chartData = view.Chart.Data.Collection.ToArray(); @@ -796,7 +815,8 @@ } }; - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition MacroStabilityInwardsInputViewChartDataAssert.AssertEmptyWaternetChartData(view.Chart.Data); @@ -833,7 +853,8 @@ }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition ChartData[] chartData = view.Chart.Data.Collection.ToArray(); @@ -874,7 +895,8 @@ }; // Call - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert MacroStabilityInwardsInputViewChartDataAssert.AssertChartData(calculation, view.Chart.Data); @@ -945,10 +967,5 @@ surfaceLine.SetGeometry(points); return surfaceLine; } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputChartControlTest.cs =================================================================== diff -u -re19c400e9676523c120e95eecc53d0446f1ff2b9 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputChartControlTest.cs (.../MacroStabilityInwardsOutputChartControlTest.cs) (revision e19c400e9676523c120e95eecc53d0446f1ff2b9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputChartControlTest.cs (.../MacroStabilityInwardsOutputChartControlTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -28,6 +28,7 @@ using Core.Components.Chart.Data; using Core.Components.Chart.Forms; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TestUtil; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -51,7 +52,8 @@ public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsOutputChartControl(null, GetTestNormativeAssessmentLevel); + TestDelegate test = () => new MacroStabilityInwardsOutputChartControl(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel); // Assert string paramName = Assert.Throws(test).ParamName; @@ -76,7 +78,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); // Call - var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel); + var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel); // Assert Assert.IsInstanceOf(control); @@ -111,7 +114,8 @@ // Call using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert IChartControl chartControl = GetChartControl(control); @@ -138,7 +142,8 @@ // Call using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert IChartControl chartControl = GetChartControl(control); @@ -169,7 +174,8 @@ }; // Call - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert IChartControl chartControl = GetChartControl(control); @@ -198,7 +204,8 @@ // Call using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert IChartControl chartControl = GetChartControl(control); @@ -226,7 +233,8 @@ }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = GetChartControl(control).Data; @@ -263,7 +271,8 @@ }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = GetChartControl(control).Data; @@ -300,7 +309,8 @@ }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = GetChartControl(control).Data; @@ -327,7 +337,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { IChartControl chartControl = GetChartControl(control); @@ -360,7 +371,8 @@ }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = GetChartControl(control).Data; @@ -395,7 +407,8 @@ }; using (var macroStabilityInwardsCalculatorFactoryConfig = new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition MacroStabilityInwardsOutputViewChartDataAssert.AssertInputChartData(calculation, GetChartControl(control).Data); @@ -426,7 +439,8 @@ Output = MacroStabilityInwardsOutputTestFactory.CreateOutput() }; - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { ChartDataCollection chartData = GetChartControl(control).Data; @@ -461,7 +475,8 @@ }; using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var control = new MacroStabilityInwardsOutputChartControl(calculation, GetTestNormativeAssessmentLevel)) + using (var control = new MacroStabilityInwardsOutputChartControl(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Precondition ChartData[] chartData = GetChartControl(control).Data.Collection.ToArray(); @@ -507,10 +522,5 @@ { return ControlTestHelper.GetControls(view, "chartControl").Single(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputViewTest.cs =================================================================== diff -u -r39a1f69b0c5cd38e6bce08a61eee61c6834638ba -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputViewTest.cs (.../MacroStabilityInwardsOutputViewTest.cs) (revision 39a1f69b0c5cd38e6bce08a61eee61c6834638ba) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsOutputViewTest.cs (.../MacroStabilityInwardsOutputViewTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -22,7 +22,6 @@ using System; using System.Linq; using System.Windows.Forms; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Components.Chart.Data; using Core.Components.Chart.Forms; @@ -47,7 +46,8 @@ public void Constructor_DataNull_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new MacroStabilityInwardsOutputView(null, GetTestNormativeAssessmentLevel); + TestDelegate test = () => new MacroStabilityInwardsOutputView(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel); // Assert string paramName = Assert.Throws(test).ParamName; @@ -72,7 +72,8 @@ var calculation = new MacroStabilityInwardsCalculationScenario(); // Call - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Assert Assert.IsInstanceOf(view); @@ -100,7 +101,8 @@ calculation.Output = MacroStabilityInwardsOutputTestFactory.CreateOutput(); // Call - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) using (var form = new Form()) { form.Controls.Add(view); @@ -132,7 +134,8 @@ using (var form = new Form()) using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { form.Controls.Add(view); form.Show(); @@ -170,7 +173,8 @@ using (var form = new Form()) using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { form.Controls.Add(view); form.Show(); @@ -209,7 +213,8 @@ using (var form = new Form()) using (new MacroStabilityInwardsCalculatorFactoryConfig()) - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { form.Controls.Add(view); form.Show(); @@ -248,7 +253,8 @@ }; using (var form = new Form()) - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { form.Controls.Add(view); form.Show(); @@ -281,7 +287,8 @@ Output = outputWithoutSlices }; - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { MacroStabilityInwardsSlicesTable slicesTable = GetSlicesTable(view); @@ -306,7 +313,8 @@ Output = MacroStabilityInwardsOutputTestFactory.CreateOutput() }; - using (var view = new MacroStabilityInwardsOutputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsOutputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { MacroStabilityInwardsSlicesTable slicesTable = GetSlicesTable(view); @@ -354,10 +362,5 @@ surfaceLine.SetGeometry(points); return surfaceLine; } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs =================================================================== diff -u -r6f33b44599df032ecae3342b0aacd606a9e87c1f -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs (.../MacroStabilityInwardsInputViewInfoTest.cs) (revision 6f33b44599df032ecae3342b0aacd606a9e87c1f) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs (.../MacroStabilityInwardsInputViewInfoTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -20,7 +20,6 @@ // All rights reserved. using System.Linq; -using Core.Common.Base.Data; using Core.Common.Controls.Views; using Core.Common.Gui.Plugin; using Core.Common.TestUtil; @@ -139,7 +138,8 @@ new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, calculationScenarioContext); @@ -167,7 +167,8 @@ new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, calculationScenarioContext); @@ -196,7 +197,8 @@ new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, calculationGroupContext); @@ -225,7 +227,8 @@ new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, calculationGroupContext); @@ -256,7 +259,8 @@ new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, calculationGroupContext); @@ -287,7 +291,8 @@ new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, calculationGroupContext); @@ -311,7 +316,8 @@ var failureMechanismContext = new MacroStabilityInwardsFailureMechanismContext(failureMechanism, assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, failureMechanismContext); @@ -335,7 +341,8 @@ var failureMechanismContext = new MacroStabilityInwardsFailureMechanismContext(new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, failureMechanismContext); @@ -362,7 +369,8 @@ var failureMechanismContext = new MacroStabilityInwardsFailureMechanismContext(failureMechanism, assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, failureMechanismContext); @@ -389,7 +397,8 @@ var failureMechanismContext = new MacroStabilityInwardsFailureMechanismContext(new MacroStabilityInwardsFailureMechanism(), assessmentSection); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, failureMechanismContext); @@ -408,7 +417,8 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculation); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, failureMechanism); @@ -426,7 +436,8 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculation); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, new MacroStabilityInwardsFailureMechanism()); @@ -447,7 +458,8 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, failureMechanism); @@ -468,7 +480,8 @@ var failureMechanism = new MacroStabilityInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, new MacroStabilityInwardsFailureMechanism()); @@ -494,7 +507,8 @@ mocks.ReplayAll(); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, assessmentSection); @@ -521,7 +535,8 @@ mocks.ReplayAll(); - using (var view = new MacroStabilityInwardsInputView(new MacroStabilityInwardsCalculationScenario(), GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(new MacroStabilityInwardsCalculationScenario(), + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, assessmentSection); @@ -551,7 +566,8 @@ mocks.ReplayAll(); - using (var view = new MacroStabilityInwardsInputView(calculation, GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, assessmentSection); @@ -581,7 +597,8 @@ mocks.ReplayAll(); - using (var view = new MacroStabilityInwardsInputView(new MacroStabilityInwardsCalculationScenario(), GetTestNormativeAssessmentLevel)) + using (var view = new MacroStabilityInwardsInputView(new MacroStabilityInwardsCalculationScenario(), + AssessmentSectionHelper.GetTestNormativeAssessmentLevel)) { // Call bool closeForData = info.CloseForData(view, assessmentSection); @@ -591,10 +608,5 @@ mocks.VerifyAll(); } } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationActivityTest.cs =================================================================== diff -u -r17c3ae55feac3fea2b80dd7e68122d0df5fcfd91 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationActivityTest.cs (.../MacroStabilityInwardsCalculationActivityTest.cs) (revision 17c3ae55feac3fea2b80dd7e68122d0df5fcfd91) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationActivityTest.cs (.../MacroStabilityInwardsCalculationActivityTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -75,7 +75,8 @@ MacroStabilityInwardsCalculationScenario invalidMacroStabilityInwardsCalculation = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenarioWithInvalidInput(); invalidMacroStabilityInwardsCalculation.Output = originalOutput; - var activity = new MacroStabilityInwardsCalculationActivity(invalidMacroStabilityInwardsCalculation, GetTestNormativeAssessmentLevel()); + var activity = new MacroStabilityInwardsCalculationActivity(invalidMacroStabilityInwardsCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Call Action call = () => activity.Run(); @@ -107,7 +108,8 @@ using (new MacroStabilityInwardsCalculatorFactoryConfig()) { - var activity = new MacroStabilityInwardsCalculationActivity(validMacroStabilityInwardsCalculation, GetTestNormativeAssessmentLevel()); + var activity = new MacroStabilityInwardsCalculationActivity(validMacroStabilityInwardsCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); activity.Run(); // Call @@ -142,7 +144,8 @@ validMacroStabilityInwardsCalculation.Output = null; validMacroStabilityInwardsCalculation.Attach(observer); - var activity = new MacroStabilityInwardsCalculationActivity(validMacroStabilityInwardsCalculation, GetTestNormativeAssessmentLevel()); + var activity = new MacroStabilityInwardsCalculationActivity(validMacroStabilityInwardsCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); activity.Run(); @@ -152,10 +155,5 @@ // Assert mocks.VerifyAll(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs =================================================================== diff -u -r17c3ae55feac3fea2b80dd7e68122d0df5fcfd91 -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 17c3ae55feac3fea2b80dd7e68122d0df5fcfd91) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -69,7 +69,8 @@ using (new MacroStabilityInwardsCalculatorFactoryConfig()) { // Call - Action call = () => MacroStabilityInwardsCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => MacroStabilityInwardsCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -90,7 +91,8 @@ invalidMacroStabilityInwardsCalculation.Output = output; // Call - bool isValid = MacroStabilityInwardsCalculationService.Validate(invalidMacroStabilityInwardsCalculation, GetTestNormativeAssessmentLevel()); + bool isValid = MacroStabilityInwardsCalculationService.Validate(invalidMacroStabilityInwardsCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert Assert.IsFalse(isValid); @@ -105,7 +107,8 @@ var isValid = true; // Call - Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(calculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -132,7 +135,8 @@ calculator.LastCreatedUpliftVanCalculator.ReturnValidationError = true; // Call - Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -158,7 +162,8 @@ calculator.LastCreatedUpliftVanCalculator.ReturnValidationWarning = true; // Call - Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -185,7 +190,8 @@ calculator.LastCreatedUpliftVanCalculator.ReturnValidationError = true; // Call - Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = MacroStabilityInwardsCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -211,7 +217,8 @@ calculatorFactory.LastCreatedUpliftVanCalculator.ThrowExceptionOnValidate = true; // Call - Action call = () => MacroStabilityInwardsCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => MacroStabilityInwardsCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessagesWithLevelAndLoggedExceptions(call, tuples => @@ -239,7 +246,7 @@ public void Calculate_ValidCalculation_LogStartAndEndOfValidatingInputsAndCalculation() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); using (new MacroStabilityInwardsCalculatorFactoryConfig()) { @@ -268,7 +275,7 @@ public void Calculate_ValidCalculationWithOutput_ShouldChangeOutput() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); MacroStabilityInwardsOutput output = MacroStabilityInwardsOutputTestFactory.CreateOutput(); testCalculation.Output = output; @@ -299,7 +306,8 @@ using (new MacroStabilityInwardsCalculatorFactoryConfig()) { // Call - MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert UpliftVanCalculatorInput actualInput = ((TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance) @@ -331,7 +339,8 @@ using (new MacroStabilityInwardsCalculatorFactoryConfig()) { // Call - MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert UpliftVanCalculatorInput actualInput = ((TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance) @@ -376,7 +385,8 @@ using (new MacroStabilityInwardsCalculatorFactoryConfig()) { // Call - MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert UpliftVanCalculatorInput actualInput = ((TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance) @@ -412,7 +422,8 @@ using (new MacroStabilityInwardsCalculatorFactoryConfig()) { // Call - MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert UpliftVanCalculatorInput actualInput = ((TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance) @@ -430,7 +441,7 @@ public void Calculate_CalculationRan_SetOutput() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); using (new MacroStabilityInwardsCalculatorFactoryConfig()) { @@ -451,7 +462,7 @@ public void Calculate_ErrorWhileCalculating_LogErrorMessageAndThrowException() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); using (new MacroStabilityInwardsCalculatorFactoryConfig()) { @@ -506,7 +517,8 @@ calculator.LastCreatedUpliftVanCalculator.ReturnCalculationError = true; // Call - Action call = () => MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -530,7 +542,8 @@ calculator.LastCreatedUpliftVanCalculator.ReturnCalculationWarning = true; // Call - Action call = () => MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -559,7 +572,8 @@ calculator.LastCreatedUpliftVanCalculator.ReturnCalculationError = true; // Call - Action call = () => MacroStabilityInwardsCalculationService.Calculate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => MacroStabilityInwardsCalculationService.Calculate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -583,7 +597,7 @@ public void Calculate_CompleteInput_SetsInputOnCalculator(bool useAssessmentLevelManualInput) { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); MacroStabilityInwardsInput input = testCalculation.InputParameters; input.AssessmentLevel = (RoundedDouble) 2.2; @@ -762,10 +776,5 @@ Assert.AreEqual(expectedGrid.NumberOfHorizontalPoints, actualGrid.NumberOfHorizontalPoints); Assert.AreEqual(expectedGrid.NumberOfVerticalPoints, actualGrid.NumberOfVerticalPoints); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs =================================================================== diff -u -r1f780b0a50ae158a4674c6b65f1623d1f588787c -rc22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision 1f780b0a50ae158a4674c6b65f1623d1f588787c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputValidatorTest.cs (.../MacroStabilityInwardsInputValidatorTest.cs) (revision c22b1f3b27e7a10c0f75bd8c7ee3d99a13ba8bc6) @@ -59,7 +59,8 @@ public void Validate_ValidInput_ReturnsEmpty() { // Call - string[] messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + string[] messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -72,7 +73,8 @@ input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -110,7 +112,8 @@ input.AssessmentLevel = (RoundedDouble) assessmentLevel; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -126,7 +129,8 @@ input.SurfaceLine = null; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -142,7 +146,8 @@ input.StochasticSoilProfile = null; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -192,7 +197,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -243,7 +249,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -268,7 +275,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -331,7 +339,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -388,7 +397,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -446,7 +456,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -520,7 +531,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -547,7 +559,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -620,7 +633,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -684,7 +698,8 @@ input.SurfaceLine = surfaceLine; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -698,7 +713,8 @@ input.ZoneBoundaryRight = (RoundedDouble) 0.2; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -718,7 +734,8 @@ input.ZoneBoundaryRight = (RoundedDouble) zoneBoundaryRight; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -742,7 +759,8 @@ input.CreateZones = createZones; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -758,7 +776,8 @@ input.TangentLineZBottom = (RoundedDouble) 1.5; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.AreEqual(new[] @@ -777,7 +796,8 @@ input.TangentLineZBottom = (RoundedDouble) 0.2; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -792,7 +812,8 @@ input.TangentLineZBottom = (RoundedDouble) 1.59; // Call - IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, GetTestNormativeAssessmentLevel()).ToArray(); + IEnumerable messages = MacroStabilityInwardsInputValidator.Validate(input, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()).ToArray(); // Assert CollectionAssert.IsEmpty(messages); @@ -1110,10 +1131,5 @@ }, new MacroStabilityInwardsPreconsolidationStress[0])) .SetName("Min X soilLayer smaller than surfaceline"); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file