Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/ClosingStructuresCalculationMessageProvider.cs
===================================================================
diff -u
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/ClosingStructuresCalculationMessageProvider.cs (revision 0)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/ClosingStructuresCalculationMessageProvider.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,50 @@
+// Copyright (C) Stichting Deltares 2017. 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.
+
+using Ringtoets.ClosingStructures.Service.Properties;
+using Ringtoets.Common.Service.MessageProviders;
+
+namespace Ringtoets.ClosingStructures.Service
+{
+ ///
+ /// This class provides messages used during the closing structures calculation.
+ ///
+ public class ClosingStructuresCalculationMessageProvider : IStructuresCalculationMessageProvider
+ {
+ public string GetCalculationFailedMessage(string calculationSubject)
+ {
+ return string.Format(Resources.ClosingStructuresCalculationService_Calculate_Error_in_ClosingStructuresCalculation_0_no_error_report,
+ calculationSubject);
+ }
+
+ public string GetCalculationFailedWithErrorReportMessage(string calculationSubject, string errorReport)
+ {
+ return string.Format(Resources.ClosingStructuresCalculationService_Calculate_Error_in_ClosingStructuresCalculation_0_click_details_for_last_error_report_1,
+ calculationSubject, errorReport);
+ }
+
+ public string GetCalculationPerformedMessage(string calculationSubject)
+ {
+ return string.Format(Resources.ClosingStructuresCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0,
+ calculationSubject);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/Ringtoets.ClosingStructures.Service.csproj
===================================================================
diff -u -r399aaf485b3a62bab47cb4fe1095179850c42853 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/Ringtoets.ClosingStructures.Service.csproj (.../Ringtoets.ClosingStructures.Service.csproj) (revision 399aaf485b3a62bab47cb4fe1095179850c42853)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Service/Ringtoets.ClosingStructures.Service.csproj (.../Ringtoets.ClosingStructures.Service.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -44,6 +44,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationMessageProviderTest.cs
===================================================================
diff -u
--- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationMessageProviderTest.cs (revision 0)
+++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/ClosingStructuresCalculationMessageProviderTest.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,95 @@
+// Copyright (C) Stichting Deltares 2017. 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.
+
+using System;
+using NUnit.Framework;
+using Ringtoets.Common.Service.MessageProviders;
+
+namespace Ringtoets.ClosingStructures.Service.Test
+{
+ [TestFixture]
+ public class ClosingStructuresCalculationMessageProviderTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Call
+ var messageProvider = new ClosingStructuresCalculationMessageProvider();
+
+ // Assert
+ Assert.IsInstanceOf(messageProvider);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationFailedMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new ClosingStructuresCalculationMessageProvider();
+
+ // Call
+ string activityDescription = provider.GetCalculationFailedMessage(name);
+
+ // Assert
+ string expectedName = $"De berekening voor kunstwerk sluiten '{name}' is mislukt. Er is geen foutrapport beschikbaar.";
+ Assert.AreEqual(expectedName, activityDescription);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationFailedWithErrorReportMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new ClosingStructuresCalculationMessageProvider();
+ const string failureMessage = "It failed!";
+
+ // Call
+ string message = provider.GetCalculationFailedWithErrorReportMessage(name, failureMessage);
+
+ // Assert
+ string expectedMessage = $"De berekening voor kunstwerk sluiten '{name}' is mislukt. " +
+ $"Bekijk het foutrapport door op details te klikken.{Environment.NewLine}{failureMessage}";
+ Assert.AreEqual(expectedMessage, message);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationPerformedMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new ClosingStructuresCalculationMessageProvider();
+
+ // Call
+ string message = provider.GetCalculationPerformedMessage(name);
+
+ // Assert
+ string expectedMessage = $"Betrouwbaarheid sluiting kunstwerk berekening is uitgevoerd op de tijdelijke locatie '{name}'. " +
+ "Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.";
+ Assert.AreEqual(expectedMessage, message);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/Ringtoets.ClosingStructures.Service.Test.csproj
===================================================================
diff -u -r399aaf485b3a62bab47cb4fe1095179850c42853 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/Ringtoets.ClosingStructures.Service.Test.csproj (.../Ringtoets.ClosingStructures.Service.Test.csproj) (revision 399aaf485b3a62bab47cb4fe1095179850c42853)
+++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Service.Test/Ringtoets.ClosingStructures.Service.Test.csproj (.../Ringtoets.ClosingStructures.Service.Test.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -55,6 +55,7 @@
+
Index: Ringtoets/Common/src/Ringtoets.Common.Service/MessageProviders/IStructuresCalculationMessageProvider.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.Service/MessageProviders/IStructuresCalculationMessageProvider.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.Service/MessageProviders/IStructuresCalculationMessageProvider.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,51 @@
+// Copyright (C) Stichting Deltares 2017. 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.Common.Service.MessageProviders
+{
+ ///
+ /// Interface for providing messages during structures calculations.
+ ///
+ public interface IStructuresCalculationMessageProvider
+ {
+ ///
+ /// Gets the message that should be used when a calculation fails.
+ ///
+ /// The calculation subject used in the calculation name.
+ /// The message.
+ string GetCalculationFailedMessage(string calculationSubject);
+
+ ///
+ /// Gets the message that should be used when a calculation fails and an error report is present.
+ ///
+ /// The calculation subject used in the calculation name.
+ /// The error report provided by the calculation.
+ /// The message.
+ string GetCalculationFailedWithErrorReportMessage(string calculationSubject, string errorReport);
+
+ ///
+ /// Gets the message that should be used when a calculation is performed.
+ ///
+ /// The calculation subject used in the calculation name.
+ /// The message.
+ string GetCalculationPerformedMessage(string calculationSubject);
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.Service/Ringtoets.Common.Service.csproj
===================================================================
diff -u -r399aaf485b3a62bab47cb4fe1095179850c42853 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/Common/src/Ringtoets.Common.Service/Ringtoets.Common.Service.csproj (.../Ringtoets.Common.Service.csproj) (revision 399aaf485b3a62bab47cb4fe1095179850c42853)
+++ Ringtoets/Common/src/Ringtoets.Common.Service/Ringtoets.Common.Service.csproj (.../Ringtoets.Common.Service.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -54,6 +54,7 @@
+
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationMessageProvider.cs
===================================================================
diff -u
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationMessageProvider.cs (revision 0)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/HeightStructuresCalculationMessageProvider.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,50 @@
+// Copyright (C) Stichting Deltares 2017. 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.
+
+using Ringtoets.Common.Service.MessageProviders;
+using Ringtoets.HeightStructures.Service.Properties;
+
+namespace Ringtoets.HeightStructures.Service
+{
+ ///
+ /// This class provides messages used during the height structures calculation.
+ ///
+ public class HeightStructuresCalculationMessageProvider : IStructuresCalculationMessageProvider
+ {
+ public string GetCalculationFailedMessage(string calculationSubject)
+ {
+ return string.Format(Resources.HeightStructuresCalculationService_Calculate_Error_in_HeightStructuresCalculation_0_no_error_report,
+ calculationSubject);
+ }
+
+ public string GetCalculationFailedWithErrorReportMessage(string calculationSubject, string errorReport)
+ {
+ return string.Format(Resources.HeightStructuresCalculationService_Calculate_Error_in_HeightStructuresCalculation_0_click_details_for_last_error_report_1,
+ calculationSubject, errorReport);
+ }
+
+ public string GetCalculationPerformedMessage(string calculationSubject)
+ {
+ return string.Format(Resources.HeightStructuresCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0,
+ calculationSubject);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj
===================================================================
diff -u -r399aaf485b3a62bab47cb4fe1095179850c42853 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj (.../Ringtoets.HeightStructures.Service.csproj) (revision 399aaf485b3a62bab47cb4fe1095179850c42853)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj (.../Ringtoets.HeightStructures.Service.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -44,6 +44,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationMessageProviderTest.cs
===================================================================
diff -u
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationMessageProviderTest.cs (revision 0)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationMessageProviderTest.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,95 @@
+// Copyright (C) Stichting Deltares 2017. 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.
+
+using System;
+using NUnit.Framework;
+using Ringtoets.Common.Service.MessageProviders;
+
+namespace Ringtoets.HeightStructures.Service.Test
+{
+ [TestFixture]
+ public class HeightStructuresCalculationMessageProviderTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Call
+ var messageProvider = new HeightStructuresCalculationMessageProvider();
+
+ // Assert
+ Assert.IsInstanceOf(messageProvider);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationFailedMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new HeightStructuresCalculationMessageProvider();
+
+ // Call
+ string activityDescription = provider.GetCalculationFailedMessage(name);
+
+ // Assert
+ string expectedName = $"De berekening voor hoogte kunstwerk '{name}' is mislukt. Er is geen foutrapport beschikbaar.";
+ Assert.AreEqual(expectedName, activityDescription);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationFailedWithErrorReportMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new HeightStructuresCalculationMessageProvider();
+ const string failureMessage = "It failed!";
+
+ // Call
+ string message = provider.GetCalculationFailedWithErrorReportMessage(name, failureMessage);
+
+ // Assert
+ string expectedMessage = $"De berekening voor hoogte kunstwerk '{name}' is mislukt. " +
+ $"Bekijk het foutrapport door op details te klikken.{Environment.NewLine}{failureMessage}";
+ Assert.AreEqual(expectedMessage, message);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationPerformedMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new HeightStructuresCalculationMessageProvider();
+
+ // Call
+ string message = provider.GetCalculationPerformedMessage(name);
+
+ // Assert
+ string expectedMessage = $"Hoogte kunstwerk berekening is uitgevoerd op de tijdelijke locatie '{name}'. " +
+ "Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.";
+ Assert.AreEqual(expectedMessage, message);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/Ringtoets.HeightStructures.Service.Test.csproj
===================================================================
diff -u -r399aaf485b3a62bab47cb4fe1095179850c42853 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/Ringtoets.HeightStructures.Service.Test.csproj (.../Ringtoets.HeightStructures.Service.Test.csproj) (revision 399aaf485b3a62bab47cb4fe1095179850c42853)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/Ringtoets.HeightStructures.Service.Test.csproj (.../Ringtoets.HeightStructures.Service.Test.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -53,6 +53,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Properties/Resources.Designer.cs
===================================================================
diff -u -r4997c48d331087a7f1fa40a7874a6f7d6ab1abd4 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 4997c48d331087a7f1fa40a7874a6f7d6ab1abd4)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -82,6 +82,16 @@
}
///
+ /// Looks up a localized string similar to Puntconstructies berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden..
+ ///
+ internal static string StabilityPointStructuresCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0 {
+ get {
+ return ResourceManager.GetString("StabilityPointStructuresCalculationService_Calculate_Calculation_temporary_direct" +
+ "ory_can_be_found_on_location_0", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to De berekening voor kunstwerk puntconstructies '{0}' is mislukt. Bekijk het foutrapport door op details te klikken.
///{1}.
///
@@ -101,15 +111,5 @@
"turesCalculation_0_no_error_report", resourceCulture);
}
}
-
- ///
- /// Looks up a localized string similar to Puntconstructies berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden..
- ///
- internal static string StabilityPointStructuresCalculationService_CalculateCalculation_temporary_directory_can_be_found_on_location_0 {
- get {
- return ResourceManager.GetString("StabilityPointStructuresCalculationService_CalculateCalculation_temporary_directo" +
- "ry_can_be_found_on_location_0", resourceCulture);
- }
- }
}
}
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Properties/Resources.resx
===================================================================
diff -u -r4997c48d331087a7f1fa40a7874a6f7d6ab1abd4 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Properties/Resources.resx (.../Resources.resx) (revision 4997c48d331087a7f1fa40a7874a6f7d6ab1abd4)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Properties/Resources.resx (.../Resources.resx) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -117,7 +117,7 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
Puntconstructies berekening is uitgevoerd op de tijdelijke locatie '{0}'. Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Ringtoets.StabilityPointStructures.Service.csproj
===================================================================
diff -u -r6050a540d11b3c891885f60e37baca24c3491a43 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Ringtoets.StabilityPointStructures.Service.csproj (.../Ringtoets.StabilityPointStructures.Service.csproj) (revision 6050a540d11b3c891885f60e37baca24c3491a43)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/Ringtoets.StabilityPointStructures.Service.csproj (.../Ringtoets.StabilityPointStructures.Service.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -50,6 +50,7 @@
Resources.resx
+
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/StabilityPointStructuresCalculationMessageProvider.cs
===================================================================
diff -u
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/StabilityPointStructuresCalculationMessageProvider.cs (revision 0)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/StabilityPointStructuresCalculationMessageProvider.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,50 @@
+// Copyright (C) Stichting Deltares 2017. 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.
+
+using Ringtoets.Common.Service.MessageProviders;
+using Ringtoets.StabilityPointStructures.Service.Properties;
+
+namespace Ringtoets.StabilityPointStructures.Service
+{
+ ///
+ /// This class provides messages used during the stability point structures calculation.
+ ///
+ public class StabilityPointStructuresCalculationMessageProvider : IStructuresCalculationMessageProvider
+ {
+ public string GetCalculationFailedMessage(string calculationSubject)
+ {
+ return string.Format(Resources.StabilityPointStructuresCalculationService_Calculate_Error_in_StabilityPointStructuresCalculation_0_no_error_report,
+ calculationSubject);
+ }
+
+ public string GetCalculationFailedWithErrorReportMessage(string calculationSubject, string errorReport)
+ {
+ return string.Format(Resources.StabilityPointStructuresCalculationService_Calculate_Error_in_StabilityPointStructuresCalculation_0_click_details_for_last_error_report_1,
+ calculationSubject, errorReport);
+ }
+
+ public string GetCalculationPerformedMessage(string calculationSubject)
+ {
+ return string.Format(Resources.StabilityPointStructuresCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0,
+ calculationSubject);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/StabilityPointStructuresCalculationService.cs
===================================================================
diff -u -rfa05755175660f1738a1c3bf82fb4505b93ffa1f -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/StabilityPointStructuresCalculationService.cs (.../StabilityPointStructuresCalculationService.cs) (revision fa05755175660f1738a1c3bf82fb4505b93ffa1f)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Service/StabilityPointStructuresCalculationService.cs (.../StabilityPointStructuresCalculationService.cs) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -151,7 +151,7 @@
calculation.Name, lastErrorFileContent);
}
- log.InfoFormat(Resources.StabilityPointStructuresCalculationService_CalculateCalculation_temporary_directory_can_be_found_on_location_0, calculator.OutputDirectory);
+ log.InfoFormat(Resources.StabilityPointStructuresCalculationService_Calculate_Calculation_temporary_directory_can_be_found_on_location_0, calculator.OutputDirectory);
CalculationServiceHelper.LogCalculationEnd();
if (errorOccurred)
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Service.Test/Ringtoets.StabilityPointStructures.Service.Test.csproj
===================================================================
diff -u -r6050a540d11b3c891885f60e37baca24c3491a43 -r461842cc9a0a60d00900065b9a7db474db7d7548
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Service.Test/Ringtoets.StabilityPointStructures.Service.Test.csproj (.../Ringtoets.StabilityPointStructures.Service.Test.csproj) (revision 6050a540d11b3c891885f60e37baca24c3491a43)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Service.Test/Ringtoets.StabilityPointStructures.Service.Test.csproj (.../Ringtoets.StabilityPointStructures.Service.Test.csproj) (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -55,6 +55,7 @@
+
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Service.Test/StabilityPointStructuresCalculationMessageProviderTest.cs
===================================================================
diff -u
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Service.Test/StabilityPointStructuresCalculationMessageProviderTest.cs (revision 0)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Service.Test/StabilityPointStructuresCalculationMessageProviderTest.cs (revision 461842cc9a0a60d00900065b9a7db474db7d7548)
@@ -0,0 +1,95 @@
+// Copyright (C) Stichting Deltares 2017. 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.
+
+using System;
+using NUnit.Framework;
+using Ringtoets.Common.Service.MessageProviders;
+
+namespace Ringtoets.StabilityPointStructures.Service.Test
+{
+ [TestFixture]
+ public class StabilityPointStructuresCalculationMessageProviderTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Call
+ var messageProvider = new StabilityPointStructuresCalculationMessageProvider();
+
+ // Assert
+ Assert.IsInstanceOf(messageProvider);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationFailedMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new StabilityPointStructuresCalculationMessageProvider();
+
+ // Call
+ string activityDescription = provider.GetCalculationFailedMessage(name);
+
+ // Assert
+ string expectedName = $"De berekening voor kunstwerk puntconstructies '{name}' is mislukt. Er is geen foutrapport beschikbaar.";
+ Assert.AreEqual(expectedName, activityDescription);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationFailedWithErrorReportMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new StabilityPointStructuresCalculationMessageProvider();
+ const string failureMessage = "It failed!";
+
+ // Call
+ string message = provider.GetCalculationFailedWithErrorReportMessage(name, failureMessage);
+
+ // Assert
+ string expectedMessage = $"De berekening voor kunstwerk puntconstructies '{name}' is mislukt. " +
+ $"Bekijk het foutrapport door op details te klikken.{Environment.NewLine}{failureMessage}";
+ Assert.AreEqual(expectedMessage, message);
+ }
+
+ [Test]
+ [TestCase(null)]
+ [TestCase("")]
+ [TestCase("value")]
+ public void GetCalculationPerformedMessage_VariousParameters_ReturnsExpectedValue(string name)
+ {
+ // Setup
+ var provider = new StabilityPointStructuresCalculationMessageProvider();
+
+ // Call
+ string message = provider.GetCalculationPerformedMessage(name);
+
+ // Assert
+ string expectedMessage = $"Puntconstructies berekening is uitgevoerd op de tijdelijke locatie '{name}'. " +
+ "Gedetailleerde invoer en uitvoer kan in de bestanden op deze locatie worden gevonden.";
+ Assert.AreEqual(expectedMessage, message);
+ }
+ }
+}
\ No newline at end of file