Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs =================================================================== diff -u -r8b37c0f11e7d78b71c298763124973e94845c87b -r8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 8c29cd869cbdd8e61e86dc49ad27bb23dc4813bf) @@ -48,7 +48,7 @@ [SetUp] public void Setup() { - testCalculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); + testCalculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(new TestHydraulicBoundaryLocation()); testSurfaceLineTopLevel = testCalculation.InputParameters.SurfaceLine.Points.Max(p => p.Z); } @@ -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 => @@ -121,10 +124,9 @@ } [Test] - public void Validate_AssessmentLevelNotCalculated_LogsErrorAndReturnsFalse() + public void Validate_NormativeAssessmentLevelNotCalculated_LogsErrorAndReturnsFalse() { // Setup - testCalculation.InputParameters.HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); testCalculation.InputParameters.UseAssessmentLevelManualInput = false; // Call @@ -156,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 => @@ -179,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 => @@ -201,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 => @@ -225,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 => @@ -255,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 => @@ -279,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 => @@ -334,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 => @@ -368,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 => @@ -415,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 => @@ -465,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 => @@ -538,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 => @@ -603,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 => @@ -661,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 => @@ -726,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 => @@ -795,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 => @@ -850,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 => @@ -917,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 => @@ -948,7 +967,7 @@ public void Calculate_ValidPipingCalculation_LogStartAndEndOfValidatingInputsAndCalculation() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); Action call = () => { @@ -974,7 +993,7 @@ public void Calculate_ValidPipingCalculationNoOutput_ShouldSetOutput() { // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); // Precondition Assert.IsNull(testCalculation.Output); @@ -1000,7 +1019,7 @@ { // Setup PipingOutput output = PipingOutputTestFactory.Create(); - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + RoundedDouble normativeAssessmentLevel = AssessmentSectionHelper.GetTestNormativeAssessmentLevel(); testCalculation.Output = output; @@ -1019,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; @@ -1044,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; @@ -1121,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