Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs =================================================================== diff -u -rcf5d53158510afca43ba9a7d2ac0893d3de29a76 -r4c15716555ea6ca122c2c9149d3703f956e3f529 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs) (revision cf5d53158510afca43ba9a7d2ac0893d3de29a76) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Integration.Test/WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationActivityIntegrationTest.cs) (revision 4c15716555ea6ca122c2c9149d3703f956e3f529) @@ -394,20 +394,35 @@ } [Test] - public void OnRun_CalculationWithWaterLevels_PerformCalculationAndLogStartAndEnd() + public void OnRun_CalculationWithValidInputConditionsAndWithoutForeshoreProfileCannotPerformCalculation_LogCalculationStartAndErrorAndEnd() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); ImportHydraulicBoundaryDatabase(assessmentSection); - WaveImpactAsphaltCoverWaveConditionsCalculation calculation = GetValidCalculation(assessmentSection); + var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation() + { + InputParameters = + { + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001), + ForeshoreProfile = null, + UseForeshore = false, + UseBreakWater = false, + StepSize = WaveConditionsInputStepSize.Half, + LowerBoundaryRevetment = (RoundedDouble) 4, + UpperBoundaryRevetment = (RoundedDouble) 10.0, + UpperBoundaryWaterLevels = (RoundedDouble) 5.4, + LowerBoundaryWaterLevels = (RoundedDouble) 5 + } + }; + calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) 12.0; var activity = new WaveImpactAsphaltCoverWaveConditionsCalculationActivity(calculation, testDataPath, assessmentSection.WaveImpactAsphaltCover, assessmentSection); - using (new WaveConditionsCalculationServiceConfig()) + using (new HydraRingCalculationServiceConfig()) { // Call Action call = () => activity.Run(); @@ -416,25 +431,30 @@ TestHelper.AssertLogMessages(call, messages => { var msgs = messages.ToArray(); - Assert.AreEqual(8, msgs.Length); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[0]); + Assert.AreEqual(10, msgs.Length); - int i = 0; + StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + + int i = 2; foreach (var waterLevel in calculation.InputParameters.WaterLevels) { StringAssert.StartsWith(string.Format("Berekening '{0}' voor waterstand '{1}' gestart om: ", calculation.Name, waterLevel), msgs[i + 1]); - StringAssert.StartsWith(string.Format("Berekening '{0}' voor waterstand '{1}' beëindigd om: ", calculation.Name, waterLevel), msgs[i + 2]); - i = i + 2; + Assert.AreEqual(string.Format("Berekening '{0}' voor waterstand '{1}' is niet gelukt.", calculation.Name, waterLevel), msgs[i + 2]); + StringAssert.StartsWith(string.Format("Berekening '{0}' voor waterstand '{1}' beëindigd om: ", calculation.Name, waterLevel), msgs[i + 3]); + + i = i + 3; } - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[7]); + StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[9]); }); - Assert.AreEqual(ActivityState.Executed, activity.State); + Assert.AreEqual(ActivityState.Failed, activity.State); } } [Test] - public void OnRun_CalculationWithValidInputConditionsAndWithoutBreakWaterCannotPerformCalculation_LogStartAndEnd() + public void OnRun_CalculationWithValidInputConditionsAndForeshoreProfileWithoutBreakWaterCannotPerformCalculation_LogCalculationStartAndEnd() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); @@ -494,7 +514,7 @@ } [Test] - public void OnRun_CalculationWithValidInputConditionsAndWithBreakWaterCannotPerformCalculation_LogStartAndEnd() + public void OnRun_CalculationWithValidInputConditionsAndForeshoreProfileWithBreakWaterCannotPerformCalculation_LogCalculationStartAndEnd() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); @@ -539,6 +559,46 @@ } [Test] + public void OnRun_CalculationWithValidCalculation_PerformCalculationAndLogStartAndEnd() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + ImportHydraulicBoundaryDatabase(assessmentSection); + + WaveImpactAsphaltCoverWaveConditionsCalculation calculation = GetValidCalculation(assessmentSection); + + var activity = new WaveImpactAsphaltCoverWaveConditionsCalculationActivity(calculation, + testDataPath, + assessmentSection.WaveImpactAsphaltCover, + assessmentSection); + + using (new WaveConditionsCalculationServiceConfig()) + { + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(8, msgs.Length); + StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[0]); + + int i = 0; + foreach (var waterLevel in calculation.InputParameters.WaterLevels) + { + StringAssert.StartsWith(string.Format("Berekening '{0}' voor waterstand '{1}' gestart om: ", calculation.Name, waterLevel), msgs[i + 1]); + StringAssert.StartsWith(string.Format("Berekening '{0}' voor waterstand '{1}' beëindigd om: ", calculation.Name, waterLevel), msgs[i + 2]); + i = i + 2; + } + + StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[7]); + }); + Assert.AreEqual(ActivityState.Executed, activity.State); + } + } + + [Test] public void OnRun_Always_SetProgressTexts() { // Setup