Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationActivity.cs =================================================================== diff -u -re2dbd70747659819d97614b9a73733babaa7b106 -r060545d4f993c38286f8d461a1f16d58143539ff --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationActivity.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivity.cs) (revision e2dbd70747659819d97614b9a73733babaa7b106) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverWaveConditionsCalculationActivity.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivity.cs) (revision 060545d4f993c38286f8d461a1f16d58143539ff) @@ -140,6 +140,12 @@ }); } - protected override void OnFinish() {} + protected override void OnFinish() + { + PerformFinish(() => + { + calculation.Output = new WaveImpactAsphaltCoverWaveConditionsOutput(Output); + }); + } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs =================================================================== diff -u -re2dbd70747659819d97614b9a73733babaa7b106 -r060545d4f993c38286f8d461a1f16d58143539ff --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs) (revision e2dbd70747659819d97614b9a73733babaa7b106) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs) (revision 060545d4f993c38286f8d461a1f16d58143539ff) @@ -45,7 +45,6 @@ { private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); - [Test] public void OnRun_NoWaterLevels_LogStartAndEnd() { @@ -61,11 +60,11 @@ ForeshoreProfile = CreateForeshoreProfile(), UseForeshore = true, UseBreakWater = true, - StepSize = (RoundedDouble)0.5, - LowerBoundaryRevetment = (RoundedDouble)5.3, - UpperBoundaryRevetment = (RoundedDouble)10, - UpperBoundaryWaterLevels = (RoundedDouble)5.4, - LowerBoundaryWaterLevels = (RoundedDouble)5 + StepSize = (RoundedDouble) 0.5, + LowerBoundaryRevetment = (RoundedDouble) 5.3, + UpperBoundaryRevetment = (RoundedDouble) 10, + UpperBoundaryWaterLevels = (RoundedDouble) 5.4, + LowerBoundaryWaterLevels = (RoundedDouble) 5 } }; @@ -206,6 +205,60 @@ } } + [Test] + public void OnFinish_CalculationPerformed_SetsOutput() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); + + var calculation = GetValidCalculation(assessmentSection); + + var activity = new WaveImpactAsphaltCoverWaveConditionsCalculationActivity(calculation, + testDataPath, + assessmentSection.WaveImpactAsphaltCover, + assessmentSection); + + using (new HydraRingCalculationServiceConfig()) + using (new WaveConditionsCalculationServiceConfig()) + { + activity.Run(); + + // Call + activity.Finish(); + + // Assert + Assert.IsNotNull(calculation.Output); + Assert.AreEqual(3, calculation.Output.Items.Count()); + } + } + + [Test] + public void OnFinish_CalculationFailed_OutputNull() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); + + var calculation = GetValidCalculation(assessmentSection); + + var activity = new WaveImpactAsphaltCoverWaveConditionsCalculationActivity(calculation, + testDataPath, + assessmentSection.WaveImpactAsphaltCover, + assessmentSection); + + using (new HydraRingCalculationServiceConfig()) + { + activity.Run(); + + // Call + activity.Finish(); + + // Assert + Assert.IsNull(calculation.Output); + } + } + private static WaveImpactAsphaltCoverWaveConditionsCalculation GetValidCalculation(AssessmentSection assessmentSection) { var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation @@ -216,14 +269,14 @@ ForeshoreProfile = CreateForeshoreProfile(), UseForeshore = true, UseBreakWater = true, - StepSize = (RoundedDouble)0.5, - LowerBoundaryRevetment = (RoundedDouble)4, - UpperBoundaryRevetment = (RoundedDouble)10, - UpperBoundaryWaterLevels = (RoundedDouble)8, - LowerBoundaryWaterLevels = (RoundedDouble)7.1 + StepSize = (RoundedDouble) 0.5, + LowerBoundaryRevetment = (RoundedDouble) 4, + UpperBoundaryRevetment = (RoundedDouble) 10, + UpperBoundaryWaterLevels = (RoundedDouble) 8, + LowerBoundaryWaterLevels = (RoundedDouble) 7.1 } }; - calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble)9.3; + calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) 9.3; return calculation; }