Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneLocation.cs
===================================================================
diff -u -r179b85228f5a860ff30681827920f25be1116c56 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneLocation.cs (.../DuneLocation.cs) (revision 179b85228f5a860ff30681827920f25be1116c56)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneLocation.cs (.../DuneLocation.cs) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -91,5 +91,10 @@
/// Gets the D50 of the dune location.
///
public RoundedDouble D50 { get; private set; }
+
+ ///
+ /// Gets or sets the output of a dune erosion calculation.
+ ///
+ public DuneLocationOutput Output { get; set; }
}
}
\ No newline at end of file
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneLocationOutput.cs
===================================================================
diff -u
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneLocationOutput.cs (revision 0)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneLocationOutput.cs (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -0,0 +1,27 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+namespace Ringtoets.DuneErosion.Data
+{
+ public class DuneLocationOutput
+ {
+ }
+}
\ No newline at end of file
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/Ringtoets.DuneErosion.Data.csproj
===================================================================
diff -u -r32061d48745c5325becd9adac3118d976587b3b6 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/Ringtoets.DuneErosion.Data.csproj (.../Ringtoets.DuneErosion.Data.csproj) (revision 32061d48745c5325becd9adac3118d976587b3b6)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/Ringtoets.DuneErosion.Data.csproj (.../Ringtoets.DuneErosion.Data.csproj) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -43,6 +43,7 @@
+
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionBoundaryCalculationService.cs
===================================================================
diff -u -rd843e2dbc351616dc406fb595edf6ae257ebe274 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionBoundaryCalculationService.cs (.../DuneErosionBoundaryCalculationService.cs) (revision d843e2dbc351616dc406fb595edf6ae257ebe274)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionBoundaryCalculationService.cs (.../DuneErosionBoundaryCalculationService.cs) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -25,9 +25,11 @@
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Service;
using Ringtoets.DuneErosion.Data;
+using Ringtoets.DuneErosion.Service.Properties;
using Ringtoets.HydraRing.Calculation.Calculator;
using Ringtoets.HydraRing.Calculation.Calculator.Factory;
using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics;
+using Ringtoets.HydraRing.Calculation.Exceptions;
namespace Ringtoets.DuneErosion.Service
{
@@ -54,19 +56,59 @@
CalculationServiceHelper.LogCalculationBeginTime(calculationName);
var exceptionThrown = false;
+ var inputValid = false;
try
{
DunesBoundaryConditionsCalculationInput calculationInput = CreateInput(duneLocation, failureMechanism, assessmentSection, hydraulicBoundaryDatabaseFilePath);
+ inputValid = true;
calculator.Calculate(calculationInput);
if (string.IsNullOrEmpty(calculator.LastErrorFileContent))
{
-
}
}
+ catch (HydraRingFileParserException)
+ {
+ if (!canceled)
+ {
+ var lastErrorContent = calculator.LastErrorFileContent;
+ if (string.IsNullOrEmpty(lastErrorContent))
+ {
+ log.ErrorFormat(Resources.DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculation_no_error_report,
+ calculationName);
+ }
+ else
+ {
+ log.ErrorFormat(Resources.DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculation_click_details_for_last_error_report_1,
+ calculationName, lastErrorContent);
+ }
+
+ exceptionThrown = true;
+ throw;
+ }
+ }
finally
{
+ var lastErrorFileContent = calculator.LastErrorFileContent;
+ bool errorOccurred = CalculationServiceHelper.ErrorOccurred(canceled, exceptionThrown, lastErrorFileContent);
+ if (errorOccurred)
+ {
+ log.ErrorFormat(Resources.DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculation_click_details_for_last_error_report_1,
+ calculationName, lastErrorFileContent);
+ }
+
+ if (inputValid)
+ {
+ log.InfoFormat(Resources.DuneErosionBoundaryCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0, calculator.OutputDirectory);
+ }
+
CalculationServiceHelper.LogCalculationEndTime(calculationName);
+
+ if (errorOccurred)
+ {
+ throw new HydraRingCalculationException(lastErrorFileContent);
+ }
+
}
}
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Properties/Resources.Designer.cs
===================================================================
diff -u
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Properties/Resources.Designer.cs (revision 0)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Properties/Resources.Designer.cs (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -0,0 +1,115 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Ringtoets.DuneErosion.Service.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.DuneErosion.Service.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Duinafslag berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden..
+ ///
+ internal static string DuneErosionBoundaryCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0 {
+ get {
+ return ResourceManager.GetString("DuneErosionBoundaryCalculationService_Calculate_Calculation_temporary_directory_c" +
+ "an_be_found_on_location_0", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De berekening voor duinafslag '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.
+ ///{1}.
+ ///
+ internal static string DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculation_click_details_for_last_error_report_1 {
+ get {
+ return ResourceManager.GetString("DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculati" +
+ "on_click_details_for_last_error_report_1", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to De berekening voor duinafslag '{0}' is niet gelukt. Er is geen foutrapport beschikbaar..
+ ///
+ internal static string DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculation_no_error_report {
+ get {
+ return ResourceManager.GetString("DuneErosionBoundaryCalculationService_Calculate_Error_in_dune_erosion_0_calculati" +
+ "on_no_error_report", resourceCulture);
+ }
+ }
+ }
+}
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Properties/Resources.resx
===================================================================
diff -u
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Properties/Resources.resx (revision 0)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Properties/Resources.resx (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Duinafslag berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.
+
+
+ De berekening voor duinafslag '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.
+{1}
+
+
+ De berekening voor duinafslag '{0}' is niet gelukt. Er is geen foutrapport beschikbaar.
+
+
\ No newline at end of file
Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj
===================================================================
diff -u -rd843e2dbc351616dc406fb595edf6ae257ebe274 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj (.../Ringtoets.DuneErosion.Service.csproj) (revision d843e2dbc351616dc406fb595edf6ae257ebe274)
+++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj (.../Ringtoets.DuneErosion.Service.csproj) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -46,6 +46,11 @@
+
+ True
+ True
+ Resources.resx
+
@@ -85,6 +90,12 @@
False
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
-
\ No newline at end of file
Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneLocationTest.cs
===================================================================
diff -u -r179b85228f5a860ff30681827920f25be1116c56 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneLocationTest.cs (.../DuneLocationTest.cs) (revision 179b85228f5a860ff30681827920f25be1116c56)
+++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneLocationTest.cs (.../DuneLocationTest.cs) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -63,6 +63,7 @@
Assert.AreEqual(offset, duneLocation.Offset.Value);
Assert.AreEqual(orientation, duneLocation.Orientation.Value);
Assert.AreEqual(d50, duneLocation.D50.Value);
+ Assert.IsNull(duneLocation.Output);
}
[Test]
Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionBoundaryCalculationServiceTest.cs
===================================================================
diff -u -rb002ca3566c04bde5fe85396b6e972c41ba3b9f1 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionBoundaryCalculationServiceTest.cs (.../DuneErosionBoundaryCalculationServiceTest.cs) (revision b002ca3566c04bde5fe85396b6e972c41ba3b9f1)
+++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionBoundaryCalculationServiceTest.cs (.../DuneErosionBoundaryCalculationServiceTest.cs) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -32,6 +32,7 @@
using Ringtoets.DuneErosion.Data.TestUtil;
using Ringtoets.HydraRing.Calculation.Calculator.Factory;
using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics;
+using Ringtoets.HydraRing.Calculation.Exceptions;
using Ringtoets.HydraRing.Calculation.TestUtil.Calculator;
namespace Ringtoets.DuneErosion.Service.Test
@@ -142,7 +143,8 @@
[Test]
public void Calculate_CancelCalculationWithValidInput_CancelsCalculator()
- {// Setup
+ {
+ // Setup
const double norm = 1.0 / 200;
const double contribution = 10;
const string ringId = "1";
@@ -182,6 +184,201 @@
mocks.VerifyAll();
}
+ [Test]
+ public void Calculate_CalculationFailedWithExceptionAndLastErrorPresent_LogErrorAndThrowException()
+ {
+ // Setup
+ const double norm = 1.0 / 200;
+ const double contribution = 10;
+ const string ringId = "1";
+ var failureMechanism = new DuneErosionFailureMechanism
+ {
+ Contribution = contribution
+ };
+
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.Stub(a => a.Id).Return(ringId);
+ assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[]
+ {
+ failureMechanism
+ });
+ assessmentSection.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(new[]
+ {
+ failureMechanism
+ }, 1, norm));
+ mocks.ReplayAll();
+
+ var duneLocation = new DuneLocation(1300001, "test", new Point2D(0, 0), 3, 0, 0, 0.000007);
+
+ using (new HydraRingCalculatorFactoryConfig())
+ {
+ var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).DunesBoundaryConditionsCalculator;
+ calculator.LastErrorFileContent = "An error occurred";
+ calculator.EndInFailure = true;
+
+ var exceptionThrown = false;
+
+ // Call
+ Action call = () =>
+ {
+ try
+ {
+ new DuneErosionBoundaryCalculationService().Calculate(duneLocation, failureMechanism, assessmentSection, validFilePath);
+ }
+ catch (HydraRingFileParserException)
+ {
+ exceptionThrown = true;
+ }
+ };
+
+ // Assert
+ TestHelper.AssertLogMessages(call, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(4, msgs.Length);
+ StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", duneLocation.Name), msgs[0]);
+ StringAssert.StartsWith(string.Format("De berekening voor duinafslag '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.", duneLocation.Name), msgs[1]);
+ StringAssert.StartsWith("Duinafslag berekening is uitgevoerd op de tijdelijke locatie", msgs[2]);
+ StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", duneLocation.Name), msgs[3]);
+ });
+ Assert.IsTrue(exceptionThrown);
+ Assert.IsNull(duneLocation.Output);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Calculate_CalculationFailedWithExceptionAndNoLastErrorPresent_LogErrorAndThrowException()
+ {
+ // Setup
+ const double norm = 1.0 / 200;
+ const double contribution = 10;
+ const string ringId = "1";
+ var failureMechanism = new DuneErosionFailureMechanism
+ {
+ Contribution = contribution
+ };
+
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.Stub(a => a.Id).Return(ringId);
+ assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[]
+ {
+ failureMechanism
+ });
+ assessmentSection.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(new[]
+ {
+ failureMechanism
+ }, 1, norm));
+ mocks.ReplayAll();
+
+ var duneLocation = new DuneLocation(1300001, "test", new Point2D(0, 0), 3, 0, 0, 0.000007);
+
+ using (new HydraRingCalculatorFactoryConfig())
+ {
+ var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).DunesBoundaryConditionsCalculator;
+ calculator.EndInFailure = true;
+
+ var exceptionThrown = false;
+
+ // Call
+ Action call = () =>
+ {
+ try
+ {
+ new DuneErosionBoundaryCalculationService().Calculate(duneLocation, failureMechanism, assessmentSection, validFilePath);
+ }
+ catch (HydraRingFileParserException)
+ {
+ exceptionThrown = true;
+ }
+ };
+
+ // Assert
+ TestHelper.AssertLogMessages(call, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(4, msgs.Length);
+ StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", duneLocation.Name), msgs[0]);
+ StringAssert.StartsWith(string.Format("De berekening voor duinafslag '{0}' is niet gelukt. Er is geen foutrapport beschikbaar.", duneLocation.Name), msgs[1]);
+ StringAssert.StartsWith("Duinafslag berekening is uitgevoerd op de tijdelijke locatie", msgs[2]);
+ StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", duneLocation.Name), msgs[3]);
+ });
+ Assert.IsTrue(exceptionThrown);
+ Assert.IsNull(duneLocation.Output);
+ }
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Calculate_CalculationFailedWithoutExceptionAndWithLastErrorPresent_LogErrorAndThrowException()
+ {
+ // Setup
+ const double norm = 1.0 / 200;
+ const double contribution = 10;
+ const string ringId = "1";
+ var failureMechanism = new DuneErosionFailureMechanism
+ {
+ Contribution = contribution
+ };
+
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ assessmentSection.Stub(a => a.Id).Return(ringId);
+ assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[]
+ {
+ failureMechanism
+ });
+ assessmentSection.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(new[]
+ {
+ failureMechanism
+ }, 1, norm));
+ mocks.ReplayAll();
+
+ var duneLocation = new DuneLocation(1300001, "test", new Point2D(0, 0), 3, 0, 0, 0.000007);
+
+ using (new HydraRingCalculatorFactoryConfig())
+ {
+ var calculator = ((TestHydraRingCalculatorFactory)HydraRingCalculatorFactory.Instance).DunesBoundaryConditionsCalculator;
+ calculator.EndInFailure = false;
+ calculator.LastErrorFileContent = "An error occurred";
+
+ var exceptionThrown = false;
+ var exceptionMessage = string.Empty;
+
+ // Call
+ Action call = () =>
+ {
+ try
+ {
+ new DuneErosionBoundaryCalculationService().Calculate(duneLocation, failureMechanism, assessmentSection, validFilePath);
+ }
+ catch (HydraRingCalculationException e)
+ {
+ exceptionThrown = true;
+ exceptionMessage = e.Message;
+ }
+ };
+
+ // Assert
+ TestHelper.AssertLogMessages(call, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(4, msgs.Length);
+ StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", duneLocation.Name), msgs[0]);
+ StringAssert.StartsWith(string.Format("De berekening voor duinafslag '{0}' is niet gelukt. Bekijk het foutrapport door op details te klikken.",
+ duneLocation.Name), msgs[1]);
+ StringAssert.StartsWith("Duinafslag berekening is uitgevoerd op de tijdelijke locatie", msgs[2]);
+ StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", duneLocation.Name), msgs[3]);
+ });
+ Assert.IsTrue(exceptionThrown);
+ Assert.IsNull(duneLocation.Output);
+ Assert.AreEqual(calculator.LastErrorFileContent, exceptionMessage);
+ }
+ mocks.VerifyAll();
+ }
+
private static void AssertInput(DunesBoundaryConditionsCalculationInput expectedInput, DunesBoundaryConditionsCalculationInput actualInput)
{
Assert.AreEqual(expectedInput.Section.SectionId, actualInput.Section.SectionId);
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DunesBoundaryConditionsCalculator.cs
===================================================================
diff -u -rb002ca3566c04bde5fe85396b6e972c41ba3b9f1 -rc3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DunesBoundaryConditionsCalculator.cs (.../DunesBoundaryConditionsCalculator.cs) (revision b002ca3566c04bde5fe85396b6e972c41ba3b9f1)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Calculator/DunesBoundaryConditionsCalculator.cs (.../DunesBoundaryConditionsCalculator.cs) (revision c3cdf6d9fadf4ad1c50d1175979c94e3e9733ed6)
@@ -32,6 +32,7 @@
///
internal class DunesBoundaryConditionsCalculator : HydraRingCalculatorBase, IDunesBoundaryConditionsCalculator
{
+ private readonly DunesBoundaryConditionsCalculationParser dunesBoundaryParser;
private readonly ReliabilityIndexCalculationParser targetProbabilityParser;
///
@@ -43,6 +44,7 @@
internal DunesBoundaryConditionsCalculator(string hlcdDirectory, string ringId)
: base(hlcdDirectory, ringId)
{
+ dunesBoundaryParser = new DunesBoundaryConditionsCalculationParser();
targetProbabilityParser = new ReliabilityIndexCalculationParser();
WaterLevel = double.NaN;
@@ -63,6 +65,13 @@
protected override void SetOutputs()
{
+ if (dunesBoundaryParser.Output != null)
+ {
+ WaterLevel = dunesBoundaryParser.Output.WaterLevel;
+ WaveHeight = dunesBoundaryParser.Output.WaveHeight;
+ WavePeriod = dunesBoundaryParser.Output.WavePeriod;
+ }
+
if (targetProbabilityParser.Output != null)
{
ReliabilityIndex = targetProbabilityParser.Output.CalculatedReliabilityIndex;