Index: Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs (.../HydraulicBoundaryLocationCalculationGuiService.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/HydraulicBoundaryLocationCalculationGuiService.cs (.../HydraulicBoundaryLocationCalculationGuiService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -58,7 +58,7 @@ } public bool CalculateDesignWaterLevels(string hydraulicBoundaryDatabasePath, - IEnumerable locations, + IEnumerable locations, string ringId, double norm, ICalculationMessageProvider messageProvider) { @@ -79,7 +79,7 @@ } public bool CalculateWaveHeights(string hydraulicBoundaryDatabasePath, - IEnumerable locations, + IEnumerable locations, string ringId, double norm, ICalculationMessageProvider messageProvider) { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs =================================================================== diff -u -r1042a38d3663daeda5a8e1083edbc63a4b6aae94 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs (.../IHydraulicBoundaryLocationCalculationGuiService.cs) (revision 1042a38d3663daeda5a8e1083edbc63a4b6aae94) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/GuiServices/IHydraulicBoundaryLocationCalculationGuiService.cs (.../IHydraulicBoundaryLocationCalculationGuiService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -27,37 +27,45 @@ namespace Ringtoets.Common.Forms.GuiServices { /// - /// Interface for and - /// calculations. + /// Interface for and + /// calculations. /// public interface IHydraulicBoundaryLocationCalculationGuiService { /// - /// Performs the calculation for all . + /// Performs the calculation for all . /// /// The path to the hydraulic boundaries database. - /// The objects to calculate + /// The objects to calculate /// the for. /// The id of the ring to perform the calculation for. /// The norm to use during the calculation. /// The message provider for the services. /// True if the observers should be notified; false if otherwise /// Thrown when /// or is null. - bool CalculateDesignWaterLevels(string hydraulicBoundaryDatabasePath, IEnumerable locations, string ringId, double norm, ICalculationMessageProvider messageProvider); + bool CalculateDesignWaterLevels(string hydraulicBoundaryDatabasePath, + IEnumerable locations, + string ringId, + double norm, + ICalculationMessageProvider messageProvider); /// - /// Performs the calculation for all . + /// Performs the calculation for all . /// /// The path to the hydraulic boundaries database. - /// The objects to calculate + /// The objects to calculate /// the for. /// The id of the ring to perform the calculation for. /// The norm to use during the calculation. /// The message provider for the services. /// True if the observers should be notified; false if otherwise /// Thrown when /// or is null. - bool CalculateWaveHeights(string hydraulicBoundaryDatabasePath, IEnumerable locations, string ringId, double norm, ICalculationMessageProvider messageProvider); + bool CalculateWaveHeights(string hydraulicBoundaryDatabasePath, + IEnumerable locations, + string ringId, + double norm, + ICalculationMessageProvider messageProvider); } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraulicBoundaryLocationsExporter.cs =================================================================== diff -u -r3d27194c4194dd405ab3471818957a64a59a0f19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraulicBoundaryLocationsExporter.cs (.../HydraulicBoundaryLocationsExporter.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraulicBoundaryLocationsExporter.cs (.../HydraulicBoundaryLocationsExporter.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -38,7 +38,7 @@ { private static readonly ILog log = LogManager.GetLogger(typeof(HydraulicBoundaryLocationsExporter)); - private readonly IEnumerable hydraulicBoundaryLocations; + private readonly IEnumerable hydraulicBoundaryLocations; private readonly string filePath; private readonly string designWaterLevelName; private readonly string waveHeightName; @@ -55,7 +55,7 @@ /// Thrown when , /// or is null. /// Thrown when is invalid. - public HydraulicBoundaryLocationsExporter(IEnumerable hydraulicBoundaryLocations, + public HydraulicBoundaryLocationsExporter(IEnumerable hydraulicBoundaryLocations, string filePath, string designWaterLevelName, string waveHeightName) { if (hydraulicBoundaryLocations == null) Index: Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationActivity.cs =================================================================== diff -u -rf95a4ded6035d61601445fa79685b9bb66a59cca -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision f95a4ded6035d61601445fa79685b9bb66a59cca) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -36,7 +36,7 @@ public class DesignWaterLevelCalculationActivity : HydraRingActivity { private static readonly ILog log = LogManager.GetLogger(typeof(DesignWaterLevelCalculationActivity)); - private readonly IHydraulicBoundaryLocation hydraulicBoundaryLocation; + private readonly HydraulicBoundaryLocation hydraulicBoundaryLocation; private readonly double norm; private readonly string hydraulicBoundaryDatabaseFilePath; private readonly string ringId; @@ -51,7 +51,11 @@ /// The norm to use during the calculation. /// The provider of the messages to use during the calculation. /// Thrown when is null. - public DesignWaterLevelCalculationActivity(IHydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, ICalculationMessageProvider messageProvider) + public DesignWaterLevelCalculationActivity(HydraulicBoundaryLocation hydraulicBoundaryLocation, + string hydraulicBoundaryDatabaseFilePath, + string ringId, + double norm, + ICalculationMessageProvider messageProvider) { if (hydraulicBoundaryLocation == null) { Index: Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs =================================================================== diff -u -r248229db928c9e5556be704ed274226f80b4ef19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision 248229db928c9e5556be704ed274226f80b4ef19) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DesignWaterLevelCalculationService.cs (.../DesignWaterLevelCalculationService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -48,7 +48,7 @@ } } - protected override AssessmentLevelCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + protected override AssessmentLevelCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); } Index: Ringtoets/Common/src/Ringtoets.Common.Service/HydraulicBoundaryLocationCalculationService.cs =================================================================== diff -u -rf95a4ded6035d61601445fa79685b9bb66a59cca -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/HydraulicBoundaryLocationCalculationService.cs (.../HydraulicBoundaryLocationCalculationService.cs) (revision f95a4ded6035d61601445fa79685b9bb66a59cca) +++ Ringtoets/Common/src/Ringtoets.Common.Service/HydraulicBoundaryLocationCalculationService.cs (.../HydraulicBoundaryLocationCalculationService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -60,7 +60,7 @@ return isValid; } - public ReliabilityIndexCalculationOutput Calculate(IHydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, ICalculationMessageProvider messageProvider) + public ReliabilityIndexCalculationOutput Calculate(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, ICalculationMessageProvider messageProvider) { string hlcdDirectory = Path.GetDirectoryName(hydraulicBoundaryDatabaseFilePath); HydraRingCalculationInput input = CreateInput(hydraulicBoundaryLocation, norm); @@ -101,6 +101,6 @@ /// The hydraulic boundary location to create the input for. /// The norm which is needed in the input. /// The created Input. - protected abstract T CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm); + protected abstract T CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm); } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Service/IHydraulicBoundaryLocationCalculationService.cs =================================================================== diff -u -rb13d0991492d2a0a463ad76af5557e10787709d2 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/IHydraulicBoundaryLocationCalculationService.cs (.../IHydraulicBoundaryLocationCalculationService.cs) (revision b13d0991492d2a0a463ad76af5557e10787709d2) +++ Ringtoets/Common/src/Ringtoets.Common.Service/IHydraulicBoundaryLocationCalculationService.cs (.../IHydraulicBoundaryLocationCalculationService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -40,16 +40,16 @@ bool Validate(string name, string hydraulicBoundaryDatabaseFilePath); /// - /// Performs a design water level calculation based on the supplied and returns the result + /// Performs a design water level calculation based on the supplied and returns the result /// if the calculation was successful. Error and status information is logged during the execution of the operation. /// - /// The to perform the calculation for. + /// The to perform the calculation for. /// The HLCD file that should be used for performing the calculation. /// The id of the ring to perform the calculation for. /// The norm to use during the calculation. /// The message provider for the services. /// A on a successful calculation, null otherwise. - ReliabilityIndexCalculationOutput Calculate(IHydraulicBoundaryLocation hydraulicBoundaryLocation, + ReliabilityIndexCalculationOutput Calculate(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, Index: Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs =================================================================== diff -u -rf95a4ded6035d61601445fa79685b9bb66a59cca -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs (.../RingtoetsCommonDataSynchronizationService.cs) (revision f95a4ded6035d61601445fa79685b9bb66a59cca) +++ Ringtoets/Common/src/Ringtoets.Common.Service/RingtoetsCommonDataSynchronizationService.cs (.../RingtoetsCommonDataSynchronizationService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -38,7 +38,7 @@ /// to clear the output for. /// Thrown when /// is null. - public static void ClearDesignWaterLevel(IHydraulicBoundaryLocation location) + public static void ClearDesignWaterLevel(HydraulicBoundaryLocation location) { if (location == null) { @@ -56,7 +56,7 @@ /// to clear the output for. /// Thrown when /// is null. - public static void ClearWaveHeight(IHydraulicBoundaryLocation location) + public static void ClearWaveHeight(HydraulicBoundaryLocation location) { if (location == null) { Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationActivity.cs =================================================================== diff -u -rf95a4ded6035d61601445fa79685b9bb66a59cca -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision f95a4ded6035d61601445fa79685b9bb66a59cca) +++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -36,7 +36,7 @@ public class WaveHeightCalculationActivity : HydraRingActivity { private static readonly ILog log = LogManager.GetLogger(typeof(WaveHeightCalculationActivity)); - private readonly IHydraulicBoundaryLocation hydraulicBoundaryLocation; + private readonly HydraulicBoundaryLocation hydraulicBoundaryLocation; private readonly double norm; private readonly string hydraulicBoundaryDatabaseFilePath; private readonly string ringId; @@ -45,13 +45,17 @@ /// /// Creates a new instance of . /// - /// The to perform the calculation for. + /// The to perform the calculation for. /// The HLCD file that should be used for performing the calculation. /// The id of the ring to perform the calculation for. /// The norm to use during the calculation. /// The provider of the messages to use during the calculation. /// Thrown when is null. - public WaveHeightCalculationActivity(IHydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, ICalculationMessageProvider messageProvider) + public WaveHeightCalculationActivity(HydraulicBoundaryLocation hydraulicBoundaryLocation, + string hydraulicBoundaryDatabaseFilePath, + string ringId, + double norm, + ICalculationMessageProvider messageProvider) { if (hydraulicBoundaryLocation == null) { Index: Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs =================================================================== diff -u -r248229db928c9e5556be704ed274226f80b4ef19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision 248229db928c9e5556be704ed274226f80b4ef19) +++ Ringtoets/Common/src/Ringtoets.Common.Service/WaveHeightCalculationService.cs (.../WaveHeightCalculationService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using log4net; using Ringtoets.HydraRing.Calculation.Data.Input.Hydraulics; using Ringtoets.HydraRing.Data; @@ -30,7 +29,6 @@ /// public class WaveHeightCalculationService : HydraulicBoundaryLocationCalculationService { - private static readonly ILog log = LogManager.GetLogger(typeof(WaveHeightCalculationService)); private static IHydraulicBoundaryLocationCalculationService instance; /// @@ -48,7 +46,7 @@ } } - protected override WaveHeightCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + protected override WaveHeightCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new WaveHeightCalculationInput(1, hydraulicBoundaryLocation.Id, norm); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs =================================================================== diff -u -r4c53b613a3442fb69a60cf60840cd87b04c0dc86 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision 4c53b613a3442fb69a60cf60840cd87b04c0dc86) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/GuiServices/HydraulicBoundaryLocationCalculationGuiServiceTest.cs (.../HydraulicBoundaryLocationCalculationGuiServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -81,7 +81,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - TestDelegate test = () => guiService.CalculateDesignWaterLevels(null, Enumerable.Empty(), "", 1, null); + TestDelegate test = () => guiService.CalculateDesignWaterLevels(null, Enumerable.Empty(), "", 1, null); // Assert string paramName = Assert.Throws(test).ParamName; @@ -179,7 +179,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - Action call = () => guiService.CalculateDesignWaterLevels(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); + Action call = () => guiService.CalculateDesignWaterLevels(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); // Assert TestHelper.AssertLogMessagesCount(call, 0); @@ -206,7 +206,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - bool successfulCalculation = guiService.CalculateDesignWaterLevels(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); + bool successfulCalculation = guiService.CalculateDesignWaterLevels(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); // Assert Assert.IsTrue(successfulCalculation); @@ -238,7 +238,7 @@ // Call Action call = () => guiService.CalculateDesignWaterLevels(validDatabasePath, - new List() + new List() { new HydraulicBoundaryLocation(1, hydraulicLocationName, 2, 3) }, @@ -283,7 +283,7 @@ // Call bool successfulCalculation = guiService.CalculateDesignWaterLevels(validDatabasePath, - new List + new List { new HydraulicBoundaryLocation(1, hydraulicLocationName, 2, 3) }, @@ -304,7 +304,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - TestDelegate test = () => guiService.CalculateWaveHeights(null, Enumerable.Empty(), "", 1, null); + TestDelegate test = () => guiService.CalculateWaveHeights(null, Enumerable.Empty(), "", 1, null); // Assert string paramName = Assert.Throws(test).ParamName; @@ -349,7 +349,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - Action call = () => guiService.CalculateWaveHeights(databasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); + Action call = () => guiService.CalculateWaveHeights(databasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); // Assert TestHelper.AssertLogMessages(call, messages => @@ -375,7 +375,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - bool successfulCalculation = guiService.CalculateWaveHeights(databasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); + bool successfulCalculation = guiService.CalculateWaveHeights(databasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); // Assert Assert.IsFalse(successfulCalculation); @@ -402,7 +402,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - Action call = () => guiService.CalculateWaveHeights(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); + Action call = () => guiService.CalculateWaveHeights(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); // Assert TestHelper.AssertLogMessagesCount(call, 0); @@ -429,7 +429,7 @@ var guiService = new HydraulicBoundaryLocationCalculationGuiService(viewParent); // Call - bool succesfulCalculation = guiService.CalculateWaveHeights(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); + bool succesfulCalculation = guiService.CalculateWaveHeights(validDatabasePath, Enumerable.Empty(), "", 1, calculationMessageProviderMock); // Assert Assert.IsTrue(succesfulCalculation); @@ -461,7 +461,7 @@ // Call Action call = () => guiService.CalculateWaveHeights(validDatabasePath, - new List() + new List() { new HydraulicBoundaryLocation(1, hydraulicLocationName, 2, 3) }, @@ -506,7 +506,7 @@ // Call bool successfulCalculation = guiService.CalculateWaveHeights(validDatabasePath, - new List + new List { new HydraulicBoundaryLocation(1, hydraulicLocationName, 2, 3) }, Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraulicBoundaryLocationsExporterTest.cs =================================================================== diff -u -r3d27194c4194dd405ab3471818957a64a59a0f19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -41,7 +41,7 @@ string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, "test.shp"); // Call - var hydraulicBoundaryLocationsExporter = new HydraulicBoundaryLocationsExporter(Enumerable.Empty(), filePath, "Toetspeil", "Golfhoogte"); + var hydraulicBoundaryLocationsExporter = new HydraulicBoundaryLocationsExporter(Enumerable.Empty(), filePath, "Toetspeil", "Golfhoogte"); // Assert Assert.IsInstanceOf(hydraulicBoundaryLocationsExporter); Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs =================================================================== diff -u -r1042a38d3663daeda5a8e1083edbc63a4b6aae94 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 1042a38d3663daeda5a8e1083edbc63a4b6aae94) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -53,8 +53,7 @@ const string locationName = "locationName"; const string activityName = "GetActivityName"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0); var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); @@ -63,8 +62,10 @@ string validFilePath = Path.Combine(testDataPath, validFile); // Call - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 1, + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 1, calculationMessageProviderMock); // Assert @@ -79,20 +80,20 @@ public void ParameteredConstructor_NullCalculationServiceMessageProvider_ThrowsArgumentNullException() { // Setup - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); string validFilePath = Path.Combine(testDataPath, validFile); // Call - TestDelegate call = () => new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 1, + TestDelegate call = () => new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 1, null); // Assert var exception = Assert.Throws(call); Assert.AreEqual("messageProvider", exception.ParamName); - mockRepository.VerifyAll(); } [Test] @@ -106,7 +107,10 @@ // Call TestDelegate call = () => new DesignWaterLevelCalculationActivity(null, - validFilePath, "", 1, calculationMessageProviderMock); + validFilePath, + string.Empty, + 1, + calculationMessageProviderMock); // Assert var exception = Assert.Throws(call); @@ -123,19 +127,21 @@ const string activityName = "GetActivityName"; const string calculationName = "locationName"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - inValidFilePath, "", 1, calculationMessageProviderMock); + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + inValidFilePath, + string.Empty, + 1, + calculationMessageProviderMock); // Call Action call = () => activity.Run(); @@ -163,17 +169,21 @@ const string ringId = "11-1"; const double norm = 30; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, ringId, norm, calculationMessageProviderMock); + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + ringId, + norm, + calculationMessageProviderMock); using (new DesignWaterLevelCalculationServiceConfig()) { @@ -184,7 +194,7 @@ // Assert Assert.AreSame(calculationMessageProviderMock, testService.MessageProvider); - Assert.AreSame(hydraulicBoundaryLocationMock, testService.HydraulicBoundaryLocation); + Assert.AreSame(hydraulicBoundaryLocation, testService.HydraulicBoundaryLocation); Assert.AreEqual(validFilePath, testService.HydraulicBoundaryDatabaseFilePath); Assert.AreEqual(ringId, testService.RingId); Assert.AreEqual(norm, testService.Norm); @@ -201,16 +211,19 @@ const string locationName = "locationName"; const string activityName = "GetActivityName"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, 3.0); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, 3.0) + }; var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); mockRepository.ReplayAll(); - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 30, + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, calculationMessageProviderMock); // Call @@ -231,19 +244,23 @@ { // Setup const string locationName = "locationName 1"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence = CalculationConvergence.CalculatedNotConverged; + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + DesignWaterLevelCalculationConvergence = CalculationConvergence.NotCalculated + }; var calculationMessageProviderMock = mockRepository.StrictMock(); - calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(""); - calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return("").Repeat.AtLeastOnce(); + calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(string.Empty); + calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(string.Empty).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); string validFilePath = Path.Combine(testDataPath, validFile); - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 30, calculationMessageProviderMock); + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, + calculationMessageProviderMock); using (new DesignWaterLevelCalculationServiceConfig()) { @@ -254,8 +271,8 @@ activity.Finish(); // Assert - Assert.IsFalse(double.IsNaN(hydraulicBoundaryLocationMock.DesignWaterLevel)); - Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence); + Assert.IsFalse(double.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel)); + Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); mockRepository.VerifyAll(); } @@ -265,18 +282,22 @@ // Setup var calculationMessageProviderMock = mockRepository.StrictMock(); const string locationName = "locationName"; - calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(""); - calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return("").Repeat.AtLeastOnce(); - - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence = CalculationConvergence.CalculatedConverged; + calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(string.Empty); + calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(string.Empty).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + DesignWaterLevelCalculationConvergence = CalculationConvergence.CalculatedConverged + }; + string validFilePath = Path.Combine(testDataPath, validFile); - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 30, calculationMessageProviderMock); + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, + calculationMessageProviderMock); using (new DesignWaterLevelCalculationServiceConfig()) { @@ -290,8 +311,8 @@ activity.Finish(); // Assert - Assert.IsNaN(hydraulicBoundaryLocationMock.DesignWaterLevel); - Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence); + Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); + Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); mockRepository.VerifyAll(); } @@ -303,21 +324,25 @@ const string activityName = "getActivityName"; const string calculationNotConvergedMessage = "GetCalculatedNotConvergedMessage"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence = CalculationConvergence.CalculatedConverged; - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return("GetCalculationName").Repeat.AtLeastOnce(); calculationMessageProviderMock.Expect(calc => calc.GetCalculatedNotConvergedMessage(locationName)).Return(calculationNotConvergedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + DesignWaterLevelCalculationConvergence = CalculationConvergence.CalculatedConverged + }; + string validFilePath = Path.Combine(testDataPath, validFile); const int norm = 300; - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", norm, calculationMessageProviderMock); + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + norm, + calculationMessageProviderMock); using (new DesignWaterLevelCalculationServiceConfig()) { @@ -328,7 +353,7 @@ } // Precondition - Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence); + Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); // Call Action call = () => activity.Finish(); @@ -341,7 +366,7 @@ StringAssert.StartsWith(calculationNotConvergedMessage, msgs[0]); StringAssert.StartsWith(string.Format("Uitvoeren van '{0}' is gelukt.", activityName), msgs[1]); }); - Assert.AreEqual(CalculationConvergence.CalculatedNotConverged, hydraulicBoundaryLocationMock.DesignWaterLevelCalculationConvergence); + Assert.AreEqual(CalculationConvergence.CalculatedNotConverged, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); mockRepository.VerifyAll(); } @@ -351,18 +376,22 @@ // Setup RoundedDouble designWaterLevel = (RoundedDouble) 3.0; const string locationName = "Name"; - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.DesignWaterLevel).Return(designWaterLevel).Repeat.AtLeastOnce(); var calculationMessageProviderMock = mockRepository.StrictMock(); - calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(""); + calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(string.Empty); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + DesignWaterLevel = designWaterLevel + }; + string validFilePath = Path.Combine(testDataPath, validFile); - var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 30, + var activity = new DesignWaterLevelCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, calculationMessageProviderMock); using (new DesignWaterLevelCalculationServiceConfig()) Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs =================================================================== diff -u -r248229db928c9e5556be704ed274226f80b4ef19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision 248229db928c9e5556be704ed274226f80b4ef19) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationServiceTest.cs (.../DesignWaterLevelCalculationServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -112,22 +112,22 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1300001).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; + using (new HydraRingCalculationServiceConfig()) { var testService = (TestHydraRingCalculationService) HydraRingCalculationService.Instance; // Call - DesignWaterLevelCalculationService.Instance.Calculate(hydraulicBoundaryLocationMock, + DesignWaterLevelCalculationService.Instance.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -140,7 +140,7 @@ var parsers = testService.Parsers.ToArray(); Assert.AreEqual(1, parsers.Length); Assert.IsInstanceOf(parsers[0]); - var expectedInput = CreateInput(hydraulicBoundaryLocationMock, norm); + var expectedInput = CreateInput(hydraulicBoundaryLocation, norm); AssertInput(expectedInput, testService.HydraRingCalculationInput); } mockRepository.VerifyAll(); @@ -159,21 +159,21 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; + ReliabilityIndexCalculationOutput output = null; using (new HydraRingCalculationServiceConfig()) { // Call - Action call = () => output = DesignWaterLevelCalculationService.Instance.Calculate(hydraulicBoundaryLocationMock, + Action call = () => output = DesignWaterLevelCalculationService.Instance.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -200,7 +200,7 @@ Assert.AreEqual(expectedInput.Beta, hydraRingCalculationInput.Beta); } - private static AssessmentLevelCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + private static AssessmentLevelCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraulicBoundaryLocationCalculationServiceTest.cs =================================================================== diff -u -r5fca1638d8f9510eebe352a8a9a86551d7ce9e61 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraulicBoundaryLocationCalculationServiceTest.cs (.../HydraulicBoundaryLocationCalculationServiceTest.cs) (revision 5fca1638d8f9510eebe352a8a9a86551d7ce9e61) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/HydraulicBoundaryLocationCalculationServiceTest.cs (.../HydraulicBoundaryLocationCalculationServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -116,24 +116,24 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1300001).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; + using (new HydraRingCalculationServiceConfig()) { var testService = (TestHydraRingCalculationService) HydraRingCalculationService.Instance; var service = new TestHydraulicBoundaryLocationCalculationService(); // Call - service.Calculate(hydraulicBoundaryLocationMock, + service.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -146,7 +146,7 @@ var parsers = testService.Parsers.ToArray(); Assert.AreEqual(1, parsers.Length); Assert.IsInstanceOf(parsers[0]); - var expectedInput = new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocationMock.Id, norm); + var expectedInput = new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); AssertInput(expectedInput, testService.HydraRingCalculationInput); } mockRepository.VerifyAll(); @@ -165,23 +165,23 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN) + }; + ReliabilityIndexCalculationOutput output = null; using (new HydraRingCalculationServiceConfig()) { var service = new TestHydraulicBoundaryLocationCalculationService(); // Call - Action call = () => output = service.Calculate(hydraulicBoundaryLocationMock, + Action call = () => output = service.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -210,7 +210,7 @@ private class TestHydraulicBoundaryLocationCalculationService : HydraulicBoundaryLocationCalculationService { - protected override AssessmentLevelCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + protected override AssessmentLevelCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); } Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs =================================================================== diff -u -r5fca1638d8f9510eebe352a8a9a86551d7ce9e61 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 5fca1638d8f9510eebe352a8a9a86551d7ce9e61) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -52,42 +52,40 @@ // Setup const string locationName = "locationName"; const string activityName = "GetActivityName"; - - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName); - + var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0); + string validFilePath = Path.Combine(testDataPath, validFile); // Call - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, validFilePath, "", 1, calculationMessageProviderMock); + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, validFilePath, "", 1, calculationMessageProviderMock); // Assert Assert.IsInstanceOf(activity); Assert.AreSame(activityName, activity.Name); Assert.IsNull(activity.ProgressText); Assert.AreEqual(ActivityState.None, activity.State); + mockRepository.VerifyAll(); } [Test] public void ParameteredConstructor_NullCalculationServiceMessageProvider_ThrowsArgumentNullException() { // Setup - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); string validFilePath = Path.Combine(testDataPath, validFile); // Call - TestDelegate call = () => new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, validFilePath, "", 1, null); + TestDelegate call = () => new WaveHeightCalculationActivity(hydraulicBoundaryLocation, validFilePath, "", 1, null); // Assert var exception = Assert.Throws(call); Assert.AreEqual("messageProvider", exception.ParamName); - mockRepository.VerifyAll(); } [Test] @@ -117,19 +115,18 @@ const string activityName = "GetActivityName"; const string calculationName = "locationName"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.WaveHeight = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, inValidFilePath, "", 1, calculationMessageProviderMock); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + WaveHeight = new RoundedDouble(2, double.NaN) + }; + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, inValidFilePath, "", 1, calculationMessageProviderMock); + // Call Action call = () => activity.Run(); @@ -156,16 +153,17 @@ const string ringId = "11-1"; const double norm = 30; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.WaveHeight = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, locationName, 0, 0) + { + WaveHeight = new RoundedDouble(2, double.NaN) + }; + + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, validFilePath, ringId, norm, calculationMessageProviderMock); @@ -179,7 +177,7 @@ // Assert Assert.AreSame(calculationMessageProviderMock, testService.MessageProvider); - Assert.AreSame(hydraulicBoundaryLocationMock, testService.HydraulicBoundaryLocation); + Assert.AreSame(hydraulicBoundaryLocation, testService.HydraulicBoundaryLocation); Assert.AreEqual(validFilePath, testService.HydraulicBoundaryDatabaseFilePath); Assert.AreEqual(ringId, testService.RingId); Assert.AreEqual(norm, testService.Norm); @@ -196,16 +194,21 @@ const string locationName = "locationName"; const string activityName = "GetActivityName"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.WaveHeight = new RoundedDouble(2, 3.0); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); mockRepository.ReplayAll(); - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, validFilePath, "", 30, calculationMessageProviderMock); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + WaveHeight = new RoundedDouble(2, 3.0) + }; + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, + calculationMessageProviderMock); + // Call Action call = () => activity.Run(); @@ -224,20 +227,25 @@ { // Setup const string locationName = "locationName"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.WaveHeight = new RoundedDouble(2, double.NaN); - hydraulicBoundaryLocationMock.WaveHeightCalculationConvergence = CalculationConvergence.CalculatedNotConverged; var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(""); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return("").Repeat.AtLeastOnce(); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + WaveHeight = new RoundedDouble(2, double.NaN), + WaveHeightCalculationConvergence = CalculationConvergence.CalculatedNotConverged + }; + string validFilePath = Path.Combine(testDataPath, validFile); - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 30, calculationMessageProviderMock); + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, + calculationMessageProviderMock); using (new WaveHeightCalculationServiceConfig()) { @@ -248,8 +256,8 @@ activity.Finish(); // Assert - Assert.IsFalse(double.IsNaN(hydraulicBoundaryLocationMock.WaveHeight)); - Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocationMock.WaveHeightCalculationConvergence); + Assert.IsFalse(double.IsNaN(hydraulicBoundaryLocation.WaveHeight)); + Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocation.WaveHeightCalculationConvergence); mockRepository.VerifyAll(); } @@ -261,17 +269,21 @@ const string locationName = "locationName"; calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(""); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return("").Repeat.AtLeastOnce(); - - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.WaveHeight = new RoundedDouble(2, double.NaN); - hydraulicBoundaryLocationMock.WaveHeightCalculationConvergence = CalculationConvergence.CalculatedConverged; mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + WaveHeight = new RoundedDouble(2, double.NaN), + WaveHeightCalculationConvergence = CalculationConvergence.CalculatedConverged + }; + string validFilePath = Path.Combine(testDataPath, validFile); - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, - validFilePath, "", 30, calculationMessageProviderMock); + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, + calculationMessageProviderMock); using (new WaveHeightCalculationServiceConfig()) { @@ -285,8 +297,8 @@ activity.Finish(); // Assert - Assert.IsNaN(hydraulicBoundaryLocationMock.WaveHeight); - Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocationMock.WaveHeightCalculationConvergence); + Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); + Assert.AreEqual(CalculationConvergence.CalculatedConverged, hydraulicBoundaryLocation.WaveHeightCalculationConvergence); mockRepository.VerifyAll(); } @@ -298,22 +310,23 @@ const string activityName = "getActivityName"; const string calculationNotConvergedMessage = "GetCalculatedNotConvergedMessage"; - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.WaveHeight = new RoundedDouble(2, double.NaN); - hydraulicBoundaryLocationMock.WaveHeightCalculationConvergence = CalculationConvergence.CalculatedConverged; - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(activityName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return("GetCalculationName").Repeat.AtLeastOnce(); calculationMessageProviderMock.Expect(calc => calc.GetCalculatedNotConvergedMessage(locationName)).Return(calculationNotConvergedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + WaveHeight = new RoundedDouble(2, double.NaN), + WaveHeightCalculationConvergence = CalculationConvergence.CalculatedConverged + }; + string validFilePath = Path.Combine(testDataPath, validFile); const int norm = 300; - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, validFilePath, - "", + string.Empty, norm, calculationMessageProviderMock); using (new WaveHeightCalculationServiceConfig()) @@ -334,7 +347,7 @@ StringAssert.StartsWith(calculationNotConvergedMessage, msgs[0]); StringAssert.StartsWith(string.Format("Uitvoeren van '{0}' is gelukt.", activityName), msgs[1]); }); - Assert.AreEqual(CalculationConvergence.CalculatedNotConverged, hydraulicBoundaryLocationMock.WaveHeightCalculationConvergence); + Assert.AreEqual(CalculationConvergence.CalculatedNotConverged, hydraulicBoundaryLocation.WaveHeightCalculationConvergence); mockRepository.VerifyAll(); } @@ -344,17 +357,23 @@ // Setup RoundedDouble waveHeight = (RoundedDouble) 3.0; const string locationName = "Name"; - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.WaveHeight).Return(waveHeight).Repeat.AtLeastOnce(); var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetActivityName(locationName)).Return(""); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + WaveHeight = waveHeight + }; + string validFilePath = Path.Combine(testDataPath, validFile); - var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocationMock, validFilePath, "", 30, calculationMessageProviderMock); + var activity = new WaveHeightCalculationActivity(hydraulicBoundaryLocation, + validFilePath, + string.Empty, + 30, + calculationMessageProviderMock); activity.Run(); Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -rb0aaf56d72d242f5d1112d007bfbf51826f5ea59 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision b0aaf56d72d242f5d1112d007bfbf51826f5ea59) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -112,21 +112,21 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1300001).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + }; + using (new HydraRingCalculationServiceConfig()) { var testService = (TestHydraRingCalculationService) HydraRingCalculationService.Instance; - WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocationMock, + WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -139,7 +139,7 @@ var parsers = testService.Parsers.ToArray(); Assert.AreEqual(1, parsers.Length); Assert.IsInstanceOf(parsers[0]); - var expectedInput = CreateInput(hydraulicBoundaryLocationMock, norm); + var expectedInput = CreateInput(hydraulicBoundaryLocation, norm); AssertInput(expectedInput, testService.HydraRingCalculationInput); } mockRepository.VerifyAll(); @@ -157,21 +157,21 @@ const double norm = 30; var mockRepository = new MockRepository(); - var hydraulicBoundaryLocationMock = mockRepository.Stub(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Id).Return(1).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.Expect(hbl => hbl.Name).Return(locationName).Repeat.AtLeastOnce(); - hydraulicBoundaryLocationMock.DesignWaterLevel = new RoundedDouble(2, double.NaN); - var calculationMessageProviderMock = mockRepository.StrictMock(); calculationMessageProviderMock.Expect(calc => calc.GetCalculationName(locationName)).Return(calculationName); calculationMessageProviderMock.Expect(calc => calc.GetCalculationFailedMessage(locationName)).Return(calculationFailedMessage).Repeat.AtLeastOnce(); mockRepository.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, locationName, 0, 0) + { + DesignWaterLevel = new RoundedDouble(2, double.NaN), + }; + ReliabilityIndexCalculationOutput output = null; using (new HydraRingCalculationServiceConfig()) { // Call - Action call = () => output = WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocationMock, + Action call = () => output = WaveHeightCalculationService.Instance.Calculate(hydraulicBoundaryLocation, validFilePath, ringId, norm, @@ -198,7 +198,7 @@ Assert.AreEqual(expectedInput.Beta, hydraRingCalculationInput.Beta); } - private static AssessmentLevelCalculationInput CreateInput(IHydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) + private static AssessmentLevelCalculationInput CreateInput(HydraulicBoundaryLocation hydraulicBoundaryLocation, double norm) { return new AssessmentLevelCalculationInput(1, hydraulicBoundaryLocation.Id, norm); } Index: Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil.Test/TestHydraulicBoundaryLocationCalculationServiceTest.cs =================================================================== diff -u -r248229db928c9e5556be704ed274226f80b4ef19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil.Test/TestHydraulicBoundaryLocationCalculationServiceTest.cs (.../TestHydraulicBoundaryLocationCalculationServiceTest.cs) (revision 248229db928c9e5556be704ed274226f80b4ef19) +++ Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil.Test/TestHydraulicBoundaryLocationCalculationServiceTest.cs (.../TestHydraulicBoundaryLocationCalculationServiceTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -54,21 +54,21 @@ var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService(); // Call - service.Calculate(hydraulicBoundaryLocationMock, + service.Calculate(hydraulicBoundaryLocation, filePath, ringId, norm, calculationMessageProviderMock); // Assert Assert.AreSame(calculationMessageProviderMock, service.MessageProvider); - Assert.AreSame(hydraulicBoundaryLocationMock, service.HydraulicBoundaryLocation); + Assert.AreSame(hydraulicBoundaryLocation, service.HydraulicBoundaryLocation); Assert.AreEqual(filePath, service.HydraulicBoundaryDatabaseFilePath); Assert.AreEqual(ringId, service.RingId); Assert.AreEqual(norm, service.Norm); @@ -82,13 +82,13 @@ var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService(); // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, @@ -108,16 +108,16 @@ var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService { CalculationConvergenceOutput = CalculationConvergence.CalculatedConverged }; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, @@ -138,16 +138,16 @@ var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService { CalculationConvergenceOutput = CalculationConvergence.NotCalculated }; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, @@ -167,16 +167,16 @@ var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService { CalculationConvergenceOutput = CalculationConvergence.CalculatedNotConverged }; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, Index: Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil.Test/WaveHeightCalculationServiceConfigTest.cs =================================================================== diff -u -r248229db928c9e5556be704ed274226f80b4ef19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil.Test/WaveHeightCalculationServiceConfigTest.cs (.../WaveHeightCalculationServiceConfigTest.cs) (revision 248229db928c9e5556be704ed274226f80b4ef19) +++ Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil.Test/WaveHeightCalculationServiceConfigTest.cs (.../WaveHeightCalculationServiceConfigTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -50,14 +50,14 @@ // Setup var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService(); const double norm = 12.34; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, @@ -75,17 +75,17 @@ // Setup var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService { CalculationConvergenceOutput = CalculationConvergence.CalculatedConverged }; const double norm = 12.34; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, @@ -104,17 +104,17 @@ // Setup var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService { CalculationConvergenceOutput = CalculationConvergence.NotCalculated }; const double norm = 12.34; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, @@ -132,17 +132,17 @@ // Setup var mockRepository = new MockRepository(); var calculationMessageProviderMock = mockRepository.StrictMock(); - var hydraulicBoundaryLocationMock = mockRepository.StrictMock(); - mockRepository.ReplayAll(); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); var service = new TestHydraulicBoundaryLocationCalculationService { CalculationConvergenceOutput = CalculationConvergence.CalculatedNotConverged }; const double norm = 12.34; // Call - ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocationMock, + ReliabilityIndexCalculationOutput output = service.Calculate(hydraulicBoundaryLocation, string.Empty, string.Empty, norm, Index: Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil/TestHydraulicBoundaryLocationCalculationService.cs =================================================================== diff -u -rd328c9a55c1d4925c83ac92d5f71bde4ba786715 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil/TestHydraulicBoundaryLocationCalculationService.cs (.../TestHydraulicBoundaryLocationCalculationService.cs) (revision d328c9a55c1d4925c83ac92d5f71bde4ba786715) +++ Ringtoets/Common/test/Ringtoets.Common.Service.TestUtil/TestHydraulicBoundaryLocationCalculationService.cs (.../TestHydraulicBoundaryLocationCalculationService.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -51,9 +51,9 @@ public ICalculationMessageProvider MessageProvider { get; private set; } /// - /// Gets the used . + /// Gets the used . /// - public IHydraulicBoundaryLocation HydraulicBoundaryLocation { get; private set; } + public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; private set; } /// /// Gets the used hydraulic boundary database file path. @@ -75,7 +75,7 @@ return true; } - public ReliabilityIndexCalculationOutput Calculate(IHydraulicBoundaryLocation hydraulicBoundaryLocation, + public ReliabilityIndexCalculationOutput Calculate(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hydraulicBoundaryDatabaseFilePath, string ringId, double norm, Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -28,7 +28,7 @@ /// /// Location of a hydraulic boundary. /// - public class HydraulicBoundaryLocation : IHydraulicBoundaryLocation + public class HydraulicBoundaryLocation { private RoundedDouble designWaterLevel; private RoundedDouble waveHeight; Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/IHydraulicBoundaryLocation.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/IHydraulicBoundaryLocation.cs (.../IHydraulicBoundaryLocation.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/IHydraulicBoundaryLocation.cs (.../IHydraulicBoundaryLocation.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -1,67 +1,67 @@ -// Copyright (C) Stichting Deltares 2016. All rights reserved. +//// 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 file is part of Ringtoets. +//using Core.Common.Base.Data; +//using Core.Common.Base.Geometry; // -// 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. +//namespace Ringtoets.HydraRing.Data +//{ +// /// +// /// Interface for an object for which a hydraulic boundary location can be stored. +// /// +// public interface IHydraulicBoundaryLocation +// { +// /// +// /// Gets the database id of . +// /// +// long Id { get; } // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// /// +// /// Gets the name of . +// /// +// string Name { get; } // -// 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 Core.Common.Base.Data; -using Core.Common.Base.Geometry; - -namespace Ringtoets.HydraRing.Data -{ - /// - /// Interface for an object for which a hydraulic boundary location can be stored. - /// - public interface IHydraulicBoundaryLocation - { - /// - /// Gets the database id of . - /// - long Id { get; } - - /// - /// Gets the name of . - /// - string Name { get; } - - /// - /// Gets the coordinates of . - /// - Point2D Location { get; } - - /// - /// Gets or sets the design water level of . - /// - RoundedDouble DesignWaterLevel { get; set; } - - /// - /// Gets or sets the wave height of . - /// - RoundedDouble WaveHeight { get; set; } - - /// - /// Gets or sets the convergence status of the design waterlevel calculation. - /// - CalculationConvergence DesignWaterLevelCalculationConvergence { get; set; } - - /// - /// Gets or sets the convergence status of the wave height calculation. - /// - CalculationConvergence WaveHeightCalculationConvergence { get; set; } - } -} \ No newline at end of file +// /// +// /// Gets the coordinates of . +// /// +// Point2D Location { get; } +// +// /// +// /// Gets or sets the design water level of . +// /// +// RoundedDouble DesignWaterLevel { get; set; } +// +// /// +// /// Gets or sets the wave height of . +// /// +// RoundedDouble WaveHeight { get; set; } +// +// /// +// /// Gets or sets the convergence status of the design waterlevel calculation. +// /// +// CalculationConvergence DesignWaterLevelCalculationConvergence { get; set; } +// +// /// +// /// Gets or sets the convergence status of the wave height calculation. +// /// +// CalculationConvergence WaveHeightCalculationConvergence { get; set; } +// } +//} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs =================================================================== diff -u -r3d27194c4194dd405ab3471818957a64a59a0f19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs (.../HydraulicBoundaryLocationsWriter.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs (.../HydraulicBoundaryLocationsWriter.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -74,7 +74,7 @@ /// is null. /// Thrown when is invalid. /// Thrown when the shapefile cannot be written. - public void WriteHydraulicBoundaryLocations(IEnumerable hydraulicBoundaryLocations, + public void WriteHydraulicBoundaryLocations(IEnumerable hydraulicBoundaryLocations, string filePath) { if (hydraulicBoundaryLocations == null) @@ -96,7 +96,7 @@ pointShapeFileWriter.SaveAs(filePath); } - private MapPointData CreateMapPointData(IHydraulicBoundaryLocation hydraulicBoundaryLocation) + private MapPointData CreateMapPointData(HydraulicBoundaryLocation hydraulicBoundaryLocation) { if (hydraulicBoundaryLocation == null) { Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs =================================================================== diff -u -r4f5e140bd0d2891988a862ff4c5749a7991a12b0 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -51,7 +51,6 @@ HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y); // Assert - Assert.IsInstanceOf(hydraulicBoundaryLocation); Assert.AreEqual(id, hydraulicBoundaryLocation.Id); Assert.AreEqual(name, hydraulicBoundaryLocation.Name); Point2D location = hydraulicBoundaryLocation.Location; Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs =================================================================== diff -u -r3d27194c4194dd405ab3471818957a64a59a0f19 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -78,7 +78,7 @@ var writer = new HydraulicBoundaryLocationsWriter("aName", "bName"); // Call - TestDelegate call = () => writer.WriteHydraulicBoundaryLocations(Enumerable.Empty(), null); + TestDelegate call = () => writer.WriteHydraulicBoundaryLocations(Enumerable.Empty(), null); // Assert Assert.Throws(call); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs =================================================================== diff -u -r8ddf67b851ff389a7e7f66d6cab29340327afedc -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs (.../FailureMechanismContributionViewIntegrationTest.cs) (revision 8ddf67b851ff389a7e7f66d6cab29340327afedc) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs (.../FailureMechanismContributionViewIntegrationTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -664,6 +664,7 @@ hydraulicBoundaryLocation.Name, hydraulicBoundaryLocation.Location.X, hydraulicBoundaryLocation.Location.Y); + assessmentSection.GrassCoverErosionOutwards.HydraulicBoundaryLocations.Add(grassCoverErosionOutwardsHydraulicBoundaryLocation); var mockRepository = new MockRepository(); Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs (.../StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs (.../StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -32,19 +32,19 @@ namespace Ringtoets.StabilityStoneCover.Forms { /// - /// A dialog which allows the user to make a selection form a given set of . Upon - /// closing of the dialog, the selected can be obtained. + /// A dialog which allows the user to make a selection form a given set of . Upon + /// closing of the dialog, the selected can be obtained. /// - public partial class StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog : SelectionDialogBase + public partial class StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog : SelectionDialogBase { /// /// Creates a new instance of . /// /// The parent of the dialog. - /// The collection of to show in the dialog. + /// The collection of to show in the dialog. /// Thrown when any parameter is null. public StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(IWin32Window dialogParent, - IEnumerable hydraulicBoundaryLocations) + IEnumerable hydraulicBoundaryLocations) : base(dialogParent) { if (hydraulicBoundaryLocations == null) @@ -55,7 +55,7 @@ InitializeComponent(); InitializeDataGridView(Resources.StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog_Location_Name); - SetDataSource(hydraulicBoundaryLocations.Select(loc => new SelectableRow(loc, loc.Name)).ToArray()); + SetDataSource(hydraulicBoundaryLocations.Select(loc => new SelectableRow(loc, loc.Name)).ToArray()); } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs =================================================================== diff -u -rf9b49f0ae3953ae90d7ce9d595e61ffa47d4b126 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision f9b49f0ae3953ae90d7ce9d595e61ffa47d4b126) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -402,10 +402,10 @@ } } - private static void GenerateStabilityStoneCoverCalculations(CalculationGroup target, IEnumerable hydraulicBoundaryLocations) + private static void GenerateStabilityStoneCoverCalculations(CalculationGroup target, IEnumerable hydraulicBoundaryLocations) { StabilityStoneCoverCalculationConfigurationHelper.AddCalculationsFromLocations( - hydraulicBoundaryLocations.OfType(), + hydraulicBoundaryLocations, target.Children); } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialogTest.cs =================================================================== diff -u -r76511556cd5348a48bb0401dae48e6ed2215fa61 -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialogTest.cs (.../StabilityStoneCoverHydraulicBoundaryLocationSelectionDialogTest.cs) (revision 76511556cd5348a48bb0401dae48e6ed2215fa61) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialogTest.cs (.../StabilityStoneCoverHydraulicBoundaryLocationSelectionDialogTest.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -25,7 +25,6 @@ using Core.Common.Controls.DataGrid; using NUnit.Extensions.Forms; using NUnit.Framework; -using Rhino.Mocks; using Ringtoets.Common.Forms; using Ringtoets.HydraRing.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -42,7 +41,7 @@ public void Constructor_WithoutParent_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(null, Enumerable.Empty()); + TestDelegate test = () => new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(null, Enumerable.Empty()); // Assert string parameter = Assert.Throws(test).ParamName; @@ -71,10 +70,10 @@ using (var viewParent = new Form()) { // Call - using (var dialog = new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(viewParent, Enumerable.Empty())) + using (var dialog = new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(viewParent, Enumerable.Empty())) { // Assert - Assert.IsInstanceOf>(dialog); + Assert.IsInstanceOf>(dialog); Assert.IsEmpty(dialog.SelectedItems); Assert.AreEqual("Selecteer hydraulische randvoorwaardenlocaties", dialog.Text); } @@ -86,7 +85,7 @@ { // Setup & Call using (var viewParent = new Form()) - using (var dialog = new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(viewParent, Enumerable.Empty())) + using (var dialog = new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(viewParent, Enumerable.Empty())) { dialog.Show(); @@ -116,16 +115,13 @@ // Setup const string testname = "testName"; - var mock = new MockRepository(); - var hydraulicBoundaryLocationMock = mock.Stub(); - hydraulicBoundaryLocationMock.Expect(h => h.Name).Return(testname); - mock.ReplayAll(); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, testname, 0, 0); // Call using (var viewParent = new Form()) using (var dialog = new StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(viewParent, new[] { - hydraulicBoundaryLocationMock + hydraulicBoundaryLocation })) { // Assert @@ -136,7 +132,6 @@ Assert.IsFalse((bool)dataGridViewControl.Rows[0].Cells[locationSelectionColumnIndex].Value); Assert.AreEqual(testname, (string)dataGridViewControl.Rows[0].Cells[locationColumnIndex].Value); } - mock.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs =================================================================== diff -u -r0d7efa62d16c64a925c63172e4d1bf1a4e0bf94f -rce190360da30edf73fb464cc0fea1d9a795aa5d4 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 0d7efa62d16c64a925c63172e4d1bf1a4e0bf94f) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision ce190360da30edf73fb464cc0fea1d9a795aa5d4) @@ -349,7 +349,7 @@ // TODO WTI-808 } - private static void GenerateWaveImpactAsphaltCoverWaveConditionsCalculations(CalculationGroup target, IEnumerable hydraulicBoundaryLocations) + private static void GenerateWaveImpactAsphaltCoverWaveConditionsCalculations(CalculationGroup target, IEnumerable hydraulicBoundaryLocations) { // TODO WTI-808 }