Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs
===================================================================
diff -u -rf9f201ed25d82301a1f9e03e909ff2b57deb7c12 -re04df496f16bc00158ac937fd0919499686883d8
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision f9f201ed25d82301a1f9e03e909ff2b57deb7c12)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision e04df496f16bc00158ac937fd0919499686883d8)
@@ -90,7 +90,7 @@
Math.Abs(Output.ActualTargetProbability - StatisticsConverter.NormToBeta(assessmentSection.FailureMechanismContribution.Norm)) <= 10e-5;
if (!designWaterLevelCalculationConvergence)
{
- log.WarnFormat("Toetspeil berekening voor locatie {0} is niet geconvergeerd.", hydraulicBoundaryLocation.Name);
+ log.WarnFormat(Resources.DesignWaterLevelCalculationActivity_DesignWaterLevel_calculation_for_location_0_not_converged, hydraulicBoundaryLocation.Name);
}
hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = designWaterLevelCalculationConvergence;
});
Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.Designer.cs
===================================================================
diff -u -r1e096895772e9946fe12cd79003d895e094b5d4b -re04df496f16bc00158ac937fd0919499686883d8
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1e096895772e9946fe12cd79003d895e094b5d4b)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e04df496f16bc00158ac937fd0919499686883d8)
@@ -61,6 +61,16 @@
}
///
+ /// Looks up a localized string similar to Toetspeil berekening voor locatie {0} is niet geconvergeerd..
+ ///
+ internal static string DesignWaterLevelCalculationActivity_DesignWaterLevel_calculation_for_location_0_not_converged {
+ get {
+ return ResourceManager.GetString("DesignWaterLevelCalculationActivity_DesignWaterLevel_calculation_for_location_0_n" +
+ "ot_converged", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Er is een fout opgetreden tijdens de toetspeil berekening '{0}': inspecteer het logbestand..
///
internal static string DesignWaterLevelCalculationService_Calculate_Error_in_design_water_level_0_calculation {
@@ -90,6 +100,16 @@
}
///
+ /// Looks up a localized string similar to Golfhoogte berekening voor locatie {0} is niet geconvergeerd..
+ ///
+ internal static string WaveHeightCalculationActivity_WaveHeight_calculation_for_location_0_not_converged {
+ get {
+ return ResourceManager.GetString("WaveHeightCalculationActivity_WaveHeight_calculation_for_location_0_not_converged" +
+ "", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Er is een fout opgetreden tijdens de golfhoogte berekening '{0}': inspecteer het logbestand..
///
internal static string WaveHeightCalculationService_Calculate_Error_in_wave_height_0_calculation {
Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.resx
===================================================================
diff -u -r1e096895772e9946fe12cd79003d895e094b5d4b -re04df496f16bc00158ac937fd0919499686883d8
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.resx (.../Resources.resx) (revision 1e096895772e9946fe12cd79003d895e094b5d4b)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/Properties/Resources.resx (.../Resources.resx) (revision e04df496f16bc00158ac937fd0919499686883d8)
@@ -135,4 +135,10 @@
Golfhoogte voor locatie {0}
+
+ Toetspeil berekening voor locatie {0} is niet geconvergeerd.
+
+
+ Golfhoogte berekening voor locatie {0} is niet geconvergeerd.
+
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs
===================================================================
diff -u -rf9f201ed25d82301a1f9e03e909ff2b57deb7c12 -re04df496f16bc00158ac937fd0919499686883d8
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision f9f201ed25d82301a1f9e03e909ff2b57deb7c12)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision e04df496f16bc00158ac937fd0919499686883d8)
@@ -90,7 +90,7 @@
Math.Abs(Output.ActualTargetProbability - StatisticsConverter.NormToBeta(assessmentSection.FailureMechanismContribution.Norm)) <= 10e-5;
if (!waveHeightCalculationConvergence)
{
- log.WarnFormat("Golfhoogte berekening voor locatie {0} is is niet geconvergeerd.", hydraulicBoundaryLocation.Name);
+ log.WarnFormat(Resources.WaveHeightCalculationActivity_WaveHeight_calculation_for_location_0_not_converged, hydraulicBoundaryLocation.Name);
}
hydraulicBoundaryLocation.WaveHeightCalculationConvergence = waveHeightCalculationConvergence;
});
Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs
===================================================================
diff -u -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 -re04df496f16bc00158ac937fd0919499686883d8
--- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision e04df496f16bc00158ac937fd0919499686883d8)
@@ -300,6 +300,46 @@
}
[Test]
+ public void Finish_ValidCalculationAndRun_LogWarningNoConvergence()
+ {
+ // Setup
+ var mockRepository = new MockRepository();
+ var assessmentSectionStub = mockRepository.Stub();
+ assessmentSectionStub.Expect(o => o.Id).Return(null);
+ assessmentSectionStub.Expect(o => o.NotifyObservers());
+
+ var failureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), 30, 30000);
+ assessmentSectionStub.Expect(asm => asm.FailureMechanismContribution).Return(failureMechanismContribution).Repeat.Twice();
+ mockRepository.ReplayAll();
+
+ ImportHydraulicBoundaryDatabase(assessmentSectionStub);
+
+ var hydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations.First(loc => loc.Id == 1300001);
+ hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = true;
+
+ var activity = new DesignWaterLevelCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation);
+
+ activity.Run();
+
+ // Precondition
+ Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
+
+ // Call
+ Action call = () => activity.Finish();
+
+ // Assert
+ TestHelper.AssertLogMessages(call, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(2, msgs.Length);
+ StringAssert.StartsWith("Toetspeil berekening voor locatie punt_flw_ 1 is niet geconvergeerd.", msgs[0]);
+ StringAssert.StartsWith("Uitvoeren van 'Toetspeil berekenen voor locatie 'punt_flw_ 1'' is gelukt.", msgs[1]);
+ });
+ Assert.IsFalse(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
+ mockRepository.VerifyAll();
+ }
+
+ [Test]
public void Finish_CalculationAlreadyRan_FinishNotPerformed()
{
// Setup
Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs
===================================================================
diff -u -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 -re04df496f16bc00158ac937fd0919499686883d8
--- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision e04df496f16bc00158ac937fd0919499686883d8)
@@ -314,6 +314,50 @@
}
[Test]
+ public void Finish_ValidCalculationAndRun_LogWarningNoConvergence()
+ {
+ // Setup
+ var mockRepository = new MockRepository();
+ var observerMock = mockRepository.StrictMock();
+ observerMock.Expect(o => o.UpdateObserver());
+
+ var assessmentSectionStub = mockRepository.Stub();
+ assessmentSectionStub.Expect(o => o.Id).Return(null);
+ assessmentSectionStub.Expect(o => o.NotifyObservers());
+
+ var failureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), 30, 30000);
+ assessmentSectionStub.Expect(asm => asm.FailureMechanismContribution).Return(failureMechanismContribution).Repeat.Twice();
+ mockRepository.ReplayAll();
+
+ ImportHydraulicBoundaryDatabase(assessmentSectionStub);
+
+ var hydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations.First(loc => loc.Id == 1300001);
+ hydraulicBoundaryLocation.WaveHeightCalculationConvergence = true;
+ hydraulicBoundaryLocation.Attach(observerMock);
+
+ var activity = new WaveHeightCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation);
+
+ activity.Run();
+
+ // Precondition
+ Assert.IsTrue(hydraulicBoundaryLocation.WaveHeightCalculationConvergence);
+
+ // Call
+ Action call = () => activity.Finish();
+
+ // Assert
+ TestHelper.AssertLogMessages(call, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(2, msgs.Length);
+ StringAssert.StartsWith("Golfhoogte berekening voor locatie punt_flw_ 1 is niet geconvergeerd.", msgs[0]);
+ StringAssert.StartsWith("Uitvoeren van 'Golfhoogte berekenen voor locatie 'punt_flw_ 1'' is gelukt.", msgs[1]);
+ });
+ Assert.IsFalse(hydraulicBoundaryLocation.WaveHeightCalculationConvergence);
+ mockRepository.VerifyAll();
+ }
+
+ [Test]
public void Finish_CalculationAlreadyRan_FinishNotPerformed()
{
// Setup