Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs =================================================================== diff -u -r2ab89f4256cd77d3386c27ca1cbd49a16f4abba2 -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 2ab89f4256cd77d3386c27ca1cbd49a16f4abba2) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -80,7 +80,9 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new PipingInputContextProperties(null, GetTestNormativeAssessmentLevel, handler); + TestDelegate test = () => new PipingInputContextProperties(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert var exception = Assert.Throws(test); @@ -135,7 +137,9 @@ assessmentSection); // Call - TestDelegate test = () => new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, null); + TestDelegate test = () => new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + null); // Assert var exception = Assert.Throws(test); @@ -162,7 +166,9 @@ assessmentSection); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert Assert.IsInstanceOf>(properties); @@ -229,7 +235,9 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler) + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler) { UseAssessmentLevelManualInput = false }; @@ -410,7 +418,9 @@ assessmentSection); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -459,7 +469,9 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler) + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler) { UseAssessmentLevelManualInput = useManualAssessmentLevelInput }; @@ -557,7 +569,9 @@ assessmentSection); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert Assert.AreEqual(inputParameters.PhreaticLevelExit.Mean, properties.PhreaticLevelExit.Mean); @@ -595,7 +609,7 @@ RoundedDouble expectedAssessmentLevel = useManualAssessmentLevelInput ? inputParameters.AssessmentLevel - : GetTestNormativeAssessmentLevel(); + : AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); Assert.AreEqual(DerivedPipingInput.GetPiezometricHeadExit(inputParameters, expectedAssessmentLevel), properties.PiezometricHeadExit); @@ -636,7 +650,9 @@ assessmentSection); var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); const double assessmentLevel = 0.36; const double entryPointL = 0.12; @@ -850,7 +866,9 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler) + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler) { ExitPointL = (RoundedDouble) exitPoint, EntryPointL = (RoundedDouble) entryPoint @@ -892,7 +910,9 @@ var handler = new ObservablePropertyChangeHandler(calculationItem, calculationItem.InputParameters); // Call - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler) + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler) { EntryPointL = (RoundedDouble) 0.5, ExitPointL = (RoundedDouble) 2 @@ -940,7 +960,9 @@ observable }); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call TestDelegate call = () => properties.ExitPointL = newExitPointL; @@ -987,7 +1009,9 @@ observable }); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call TestDelegate call = () => properties.EntryPointL = entryPoint; @@ -1034,7 +1058,9 @@ observable }); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call TestDelegate call = () => properties.EntryPointL = entryPointL; @@ -1079,7 +1105,9 @@ observable }); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call TestDelegate call = () => properties.ExitPointL = exitPointL; @@ -1120,7 +1148,9 @@ var handler = new SetPropertyValueAfterConfirmationParameterTester(new IObservable[0]); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); inputParameters.StochasticSoilProfile = new PipingStochasticSoilProfile(0.0, PipingSoilProfileTestFactory.CreatePipingSoilProfile()); @@ -1172,7 +1202,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call properties.SurfaceLine = testSurfaceLine; @@ -1223,7 +1255,9 @@ var handler = new SetPropertyValueAfterConfirmationParameterTester(new IObservable[0]); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call properties.SurfaceLine = newSurfaceLine; @@ -1248,7 +1282,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable surfaceLines = properties.GetAvailableSurfaceLines(); @@ -1272,7 +1308,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition: Assert.IsNull(calculation.InputParameters.SurfaceLine); @@ -1339,7 +1377,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition: Assert.IsNotNull(calculation.InputParameters.SurfaceLine); @@ -1370,7 +1410,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition Assert.IsNull(calculation.InputParameters.StochasticSoilModel); @@ -1408,7 +1450,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Precondition Assert.IsNotNull(calculation.InputParameters.StochasticSoilModel); @@ -1435,7 +1479,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = null; @@ -1485,7 +1531,9 @@ failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // When IEnumerable availableHydraulicBoundaryLocations = @@ -1527,7 +1575,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable selectableHydraulicBoundaryLocations = @@ -1579,7 +1629,9 @@ var context = new PipingInputContext(calculation.InputParameters, calculation, failureMechanism.SurfaceLines, failureMechanism.StochasticSoilModels, failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable selectableHydraulicBoundaryLocations = @@ -1644,7 +1696,9 @@ observable }); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); IEnumerable originalList = properties.GetSelectableHydraulicBoundaryLocations() .ToList(); @@ -1694,7 +1748,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicReadOnlyValidationMethod("AssessmentLevel"); @@ -1721,7 +1777,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicReadOnlyValidationMethod("prop"); @@ -1757,7 +1815,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicVisibleValidationMethod("SelectedHydraulicBoundaryLocation"); @@ -1784,7 +1844,9 @@ Enumerable.Empty(), failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call bool result = properties.DynamicVisibleValidationMethod("prop"); @@ -1820,7 +1882,9 @@ observable }); - var properties = new PipingInputContextProperties(context, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call setProperty(properties); @@ -1830,11 +1894,6 @@ mocks.VerifyAll(); } - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } - private static PipingStochasticSoilModel ValidStochasticSoilModel(double xMin, double xMax) { return new PipingStochasticSoilModel("StochasticSoilModelName", new[] Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextStochasticSoilModelSelectionEditorTest.cs =================================================================== diff -u -rc3bad8213c1debff4131283d231797544ed28294 -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextStochasticSoilModelSelectionEditorTest.cs (.../PipingInputContextStochasticSoilModelSelectionEditorTest.cs) (revision c3bad8213c1debff4131283d231797544ed28294) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextStochasticSoilModelSelectionEditorTest.cs (.../PipingInputContextStochasticSoilModelSelectionEditorTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -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.Piping.Data; using Ringtoets.Piping.Data.SoilProfile; @@ -72,7 +72,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(pipingInputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(pipingInputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new PipingInputContextStochasticSoilModelSelectionEditor(); var someValue = new object(); @@ -140,7 +142,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new PipingInputContextStochasticSoilModelSelectionEditor(); var someValue = new object(); @@ -160,10 +164,5 @@ mockRepository.VerifyAll(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditorTest.cs =================================================================== diff -u -rc3bad8213c1debff4131283d231797544ed28294 -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditorTest.cs (.../PipingInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision c3bad8213c1debff4131283d231797544ed28294) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextStochasticSoilProfileSelectionEditorTest.cs (.../PipingInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -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.Piping.Data; using Ringtoets.Piping.Data.SoilProfile; @@ -72,7 +72,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(pipingInputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(pipingInputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new PipingInputContextStochasticSoilProfileSelectionEditor(); var someValue = new object(); @@ -140,7 +142,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new PipingInputContextStochasticSoilProfileSelectionEditor(); var someValue = new object(); @@ -160,10 +164,5 @@ mockRepository.VerifyAll(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextSurfaceLineSelectionEditorTest.cs =================================================================== diff -u -rc3bad8213c1debff4131283d231797544ed28294 -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextSurfaceLineSelectionEditorTest.cs (.../PipingInputContextSurfaceLineSelectionEditorTest.cs) (revision c3bad8213c1debff4131283d231797544ed28294) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/UITypeEditors/PipingInputContextSurfaceLineSelectionEditorTest.cs (.../PipingInputContextSurfaceLineSelectionEditorTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -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.Piping.Data; using Ringtoets.Piping.Data.SoilProfile; @@ -70,7 +70,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new PipingInputContextSurfaceLineSelectionEditor(); var someValue = new object(); @@ -125,7 +127,9 @@ failureMechanism, assessmentSection); - var properties = new PipingInputContextProperties(inputParametersContext, GetTestNormativeAssessmentLevel, handler); + var properties = new PipingInputContextProperties(inputParametersContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); var editor = new PipingInputContextSurfaceLineSelectionEditor(); var someValue = new object(); @@ -146,11 +150,6 @@ mockRepository.VerifyAll(); } - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } - private static PipingSurfaceLine ValidSurfaceLine() { var surfaceLine = new PipingSurfaceLine(string.Empty); Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationActivityTest.cs =================================================================== diff -u -r2038c5829fffec5023a2fcac1cf3d493b097835e -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationActivityTest.cs (.../PipingCalculationActivityTest.cs) (revision 2038c5829fffec5023a2fcac1cf3d493b097835e) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationActivityTest.cs (.../PipingCalculationActivityTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -77,7 +77,7 @@ invalidPipingCalculation.Output = originalOutput; var activity = new PipingCalculationActivity(invalidPipingCalculation, - GetTestNormativeAssessmentLevel()); + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Call Action call = () => activity.Run(); @@ -110,7 +110,7 @@ validPipingCalculation.Output = null; var activity = new PipingCalculationActivity(validPipingCalculation, - GetTestNormativeAssessmentLevel()); + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); activity.Run(); // Call @@ -145,7 +145,7 @@ validPipingCalculation.Attach(observer); var activity = new PipingCalculationActivity(validPipingCalculation, - GetTestNormativeAssessmentLevel()); + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); activity.Run(); @@ -155,10 +155,5 @@ // Assert mocks.VerifyAll(); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs =================================================================== diff -u -r1f780b0a50ae158a4674c6b65f1623d1f588787c -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 1f780b0a50ae158a4674c6b65f1623d1f588787c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -67,7 +67,8 @@ public void Validate_Always_LogStartAndEndOfValidatingInputs() { // Call - Action call = () => PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -87,7 +88,8 @@ invalidPipingCalculation.Output = output; // Call - bool isValid = PipingCalculationService.Validate(invalidPipingCalculation, GetTestNormativeAssessmentLevel()); + bool isValid = PipingCalculationService.Validate(invalidPipingCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert Assert.IsFalse(isValid); @@ -102,7 +104,8 @@ // Call var isValid = false; - Action call = () => isValid = PipingCalculationService.Validate(calculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(calculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -155,7 +158,8 @@ // Call var isValid = false; - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -178,7 +182,8 @@ // Call var isValid = false; - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -200,7 +205,8 @@ // Call var isValid = false; - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -224,7 +230,8 @@ // Call var isValid = false; - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -254,7 +261,8 @@ // Call var isValid = false; - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -278,7 +286,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -333,7 +342,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -367,7 +377,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -414,7 +425,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -464,7 +476,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -537,7 +550,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -602,7 +616,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -660,7 +675,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -725,7 +741,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -794,7 +811,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -849,7 +867,8 @@ var isValid = false; // Call - Action call = () => isValid = PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => isValid = PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -916,7 +935,8 @@ testCalculation.InputParameters.StochasticSoilProfile = new PipingStochasticSoilProfile(0.0, profile); // Call - Action call = () => PipingCalculationService.Validate(testCalculation, GetTestNormativeAssessmentLevel()); + Action call = () => PipingCalculationService.Validate(testCalculation, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel()); // Assert TestHelper.AssertLogMessages(call, messages => @@ -947,7 +967,7 @@ public void Calculate_ValidPipingCalculation_LogStartAndEndOfValidatingInputsAndCalculation() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); Action call = () => { @@ -973,7 +993,7 @@ public void Calculate_ValidPipingCalculationNoOutput_ShouldSetOutput() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); // Precondition Assert.IsNull(testCalculation.Output); @@ -999,7 +1019,7 @@ { // Setup PipingOutput output = PipingOutputTestFactory.Create(); - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); testCalculation.Output = output; @@ -1018,7 +1038,7 @@ public void Validate_CompleteInput_InputSetOnSubCalculators(bool useAssessmentLevelManualInput) { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); PipingInput input = testCalculation.InputParameters; input.AssessmentLevel = (RoundedDouble) 2.2; @@ -1043,7 +1063,7 @@ public void Calculate_CompleteInput_InputSetOnSubCalculators(bool useAssessmentLevelManualInput) { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); PipingInput input = testCalculation.InputParameters; input.UseAssessmentLevelManualInput = useAssessmentLevelManualInput; @@ -1120,10 +1140,5 @@ Assert.AreEqual(input.SandParticlesVolumicWeight, sellmeijerCalculator.GammaSubParticles); Assert.AreEqual(input.Gravity, sellmeijerCalculator.Gravity); } - - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } } } \ No newline at end of file Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs =================================================================== diff -u -rfd6fc8963fb4dbf6f2b5edae0991994983d6a1f6 -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs (.../WaveConditionsInputContextPropertiesTest.cs) (revision fd6fc8963fb4dbf6f2b5edae0991994983d6a1f6) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PropertyClasses/WaveConditionsInputContextPropertiesTest.cs (.../WaveConditionsInputContextPropertiesTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -77,7 +77,9 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new TestWaveConditionsInputContextProperties(null, GetTestNormativeAssessmentLevel, handler); + TestDelegate test = () => new TestWaveConditionsInputContextProperties(null, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert string paramName = Assert.Throws(test).ParamName; @@ -119,7 +121,9 @@ new AssessmentSectionStub()); // Call - TestDelegate test = () => new TestWaveConditionsInputContextProperties(context, GetTestNormativeAssessmentLevel, null); + TestDelegate test = () => new TestWaveConditionsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + null); // Assert var exception = Assert.Throws(test); @@ -234,7 +238,9 @@ }, assessmentSection); // Call - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -484,7 +490,9 @@ var input = new WaveConditionsInput(); var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = null; @@ -519,7 +527,9 @@ }; var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable availableHydraulicBoundaryLocations = @@ -561,7 +571,9 @@ }); var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call SelectableHydraulicBoundaryLocation selectedHydraulicBoundaryLocation = properties.SelectedHydraulicBoundaryLocation; @@ -603,7 +615,9 @@ var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // When IEnumerable availableHydraulicBoundaryLocations = @@ -639,7 +653,9 @@ var input = new WaveConditionsInput(); var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable availableHydraulicBoundaryLocations = properties.GetSelectableHydraulicBoundaryLocations(); @@ -680,7 +696,9 @@ var inputContext = new TestWaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable availableHydraulicBoundaryLocations = properties.GetSelectableHydraulicBoundaryLocations(); @@ -721,7 +739,9 @@ var otherProfile = new TestForeshoreProfile(new Point2D(0, 190)); var customHandler = new SetPropertyValueAfterConfirmationParameterTester(Enumerable.Empty()); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, customHandler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + customHandler); IEnumerable originalList = properties.GetSelectableHydraulicBoundaryLocations() .ToList(); @@ -761,7 +781,9 @@ var input = new WaveConditionsInput(); var inputContext = new TestWaveConditionsInputContext(input, foreshoreProfiles, assessmentSection); - var properties = new TestWaveConditionsInputContextProperties(inputContext, GetTestNormativeAssessmentLevel, handler); + var properties = new TestWaveConditionsInputContextProperties(inputContext, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + handler); // Call IEnumerable availableForeshoreProfiles = properties.GetAvailableForeshoreProfiles(); @@ -796,7 +818,9 @@ observable }); - var properties = new TestWaveConditionsInputContextProperties(context, GetTestNormativeAssessmentLevel, customHandler); + var properties = new TestWaveConditionsInputContextProperties(context, + AssessmentSectionHelper.GetTestNormativeAssessmentLevel, + customHandler); // Call setProperty(properties); @@ -806,11 +830,6 @@ mocks.VerifyAll(); } - private static RoundedDouble GetTestNormativeAssessmentLevel() - { - return (RoundedDouble) 1.1; - } - private class TestWaveConditionsInputContextProperties : WaveConditionsInputContextProperties { public TestWaveConditionsInputContextProperties(WaveConditionsInputContext context,