Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs =================================================================== diff -u -r5c7faf8283e49113a2c7b9e17086148a99f13d2e -r17c3ae55feac3fea2b80dd7e68122d0df5fcfd91 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 5c7faf8283e49113a2c7b9e17086148a99f13d2e) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsCalculationServiceTest.cs (.../MacroStabilityInwardsCalculationServiceTest.cs) (revision 17c3ae55feac3fea2b80dd7e68122d0df5fcfd91) @@ -26,6 +26,7 @@ using Core.Common.TestUtil; using log4net.Core; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Service.TestUtil; using Ringtoets.MacroStabilityInwards.CalculatedInput.TestUtil; using Ringtoets.MacroStabilityInwards.Data; @@ -47,7 +48,7 @@ [SetUp] public void Setup() { - testCalculation = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenarioWithValidInput(); + testCalculation = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenarioWithValidInput(new TestHydraulicBoundaryLocation()); } [Test] @@ -285,31 +286,6 @@ } } - [TestCase(true)] - [TestCase(false)] - public void Calculate_CompleteInput_SetsInputOnCalculator(bool useAssessmentLevelManualInput) - { - // Setup - RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); - MacroStabilityInwardsInput input = testCalculation.InputParameters; - - input.AssessmentLevel = (RoundedDouble) 2.2; - - input.UseAssessmentLevelManualInput = useAssessmentLevelManualInput; - using (new MacroStabilityInwardsCalculatorFactoryConfig()) - { - // Call - MacroStabilityInwardsCalculationService.Calculate(testCalculation, normativeAssessmentLevel); - - // Assert - RoundedDouble expectedAssessmentLevel = useAssessmentLevelManualInput - ? testCalculation.InputParameters.AssessmentLevel - : normativeAssessmentLevel; - - AssertInput(testCalculation.InputParameters, (TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance, expectedAssessmentLevel); - } - } - [Test] public void Calculate_DrainageConstructionPresentFalse_SetsInputOnCalculator() { @@ -602,6 +578,31 @@ } } + [TestCase(true)] + [TestCase(false)] + public void Calculate_CompleteInput_SetsInputOnCalculator(bool useAssessmentLevelManualInput) + { + // Setup + RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); + MacroStabilityInwardsInput input = testCalculation.InputParameters; + + input.AssessmentLevel = (RoundedDouble) 2.2; + + input.UseAssessmentLevelManualInput = useAssessmentLevelManualInput; + using (new MacroStabilityInwardsCalculatorFactoryConfig()) + { + // Call + MacroStabilityInwardsCalculationService.Calculate(testCalculation, normativeAssessmentLevel); + + // Assert + RoundedDouble expectedAssessmentLevel = useAssessmentLevelManualInput + ? testCalculation.InputParameters.AssessmentLevel + : normativeAssessmentLevel; + + AssertInput(testCalculation.InputParameters, (TestMacroStabilityInwardsCalculatorFactory) MacroStabilityInwardsCalculatorFactory.Instance, expectedAssessmentLevel); + } + } + private static void AssertInput(MacroStabilityInwardsInput originalInput, TestMacroStabilityInwardsCalculatorFactory factory, RoundedDouble expectedAssessmentLevel) { UpliftVanCalculatorInput actualInput = factory.LastCreatedUpliftVanCalculator.Input;