Index: Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs =================================================================== diff -u -rc09b65e09c7af06495433e73530b900c46414392 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision c09b65e09c7af06495433e73530b900c46414392) +++ Core/Common/src/Core.Common.Base/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -116,6 +116,16 @@ } /// + /// Looks up a localized string similar to Gras erosie kruin en binnentalud '{0}' niet gelukt.. + /// + public static string GrassCoverErosionInwardsCalculationService_Calculate_Error_in_grass_cover_erosion_inwards_0_calculation { + get { + return ResourceManager.GetString("GrassCoverErosionInwardsCalculationService_Calculate_Error_in_grass_cover_erosion" + + "_inwards_0_calculation", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Punten voor een lijn moeten uit elkaar liggen om een lijn te kunnen vormen.. /// public static string Math2D_LineIntersectionWithLine_Line_points_are_equal { Index: Core/Common/src/Core.Common.Base/Properties/Resources.resx =================================================================== diff -u -rc09b65e09c7af06495433e73530b900c46414392 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision c09b65e09c7af06495433e73530b900c46414392) +++ Core/Common/src/Core.Common.Base/Properties/Resources.resx (.../Resources.resx) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -177,4 +177,7 @@ De waarde moet tussen 0 en 1 zijn. + + Gras erosie kruin en binnentalud '{0}' niet gelukt. + \ No newline at end of file Index: Core/Common/test/Core.Common.TestUtil/TestDataPath.cs =================================================================== diff -u -rfe9af51d0ecee9dc64884d9370cf951fe787a8bc -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision fe9af51d0ecee9dc64884d9370cf951fe787a8bc) +++ Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -48,6 +48,11 @@ public static readonly TestDataPath IO = System.IO.Path.Combine("Ringtoets", "Common", "test", "Ringtoets.Common.IO.Test"); } + public static class HeightStructures + { + public static readonly TestDataPath Integration = System.IO.Path.Combine("Ringtoets", "HeightStructures", "test", "Ringtoets.HeightStructures.Integration.Test"); + } + public static class HydraRing { public static readonly TestDataPath IO = System.IO.Path.Combine("Ringtoets", "HydraRing", "test", "Ringtoets.HydraRing.IO.Test"); Index: Ringtoets/Common/src/Ringtoets.Common.Service/DateTimeService.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Service/DateTimeService.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Service/DateTimeService.cs (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,42 @@ +// 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. + +using System; + +namespace Ringtoets.Common.Service +{ + /// + /// The class is responsible for providing general operations. + /// + public static class DateTimeService + { + /// + /// Gets the current time in HH:mm:ss format. + /// + public static string CurrentTimeAsString + { + get + { + return DateTime.Now.ToString("HH:mm:ss"); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.Designer.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.Designer.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.Designer.cs (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,117 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.17929 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Ringtoets.Common.Service.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Ringtoets.Common.Service.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Berekening van '{0}' beëindigd om: {1}. + /// + public static string Calculation_Subject_0_ended_Time_1_ { + get { + return ResourceManager.GetString("Calculation_Subject_0_ended_Time_1_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Berekening van '{0}' gestart om: {1}. + /// + public static string Calculation_Subject_0_started_Time_1_ { + get { + return ResourceManager.GetString("Calculation_Subject_0_started_Time_1_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Er is geen hydraulische randvoorwaarde locatie geselecteerd.. + /// + public static string CalculationService_ValidateInput_No_hydraulic_boundary_location_selected { + get { + return ResourceManager.GetString("CalculationService_ValidateInput_No_hydraulic_boundary_location_selected", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Validatie mislukt: {0}. + /// + public static string Error_in_validation_0 { + get { + return ResourceManager.GetString("Error_in_validation_0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Validatie van '{0}' beëindigd om: {1}. + /// + public static string Validation_Subject_0_ended_Time_1_ { + get { + return ResourceManager.GetString("Validation_Subject_0_ended_Time_1_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Validatie van '{0}' gestart om: {1}. + /// + public static string Validation_Subject_0_started_Time_1_ { + get { + return ResourceManager.GetString("Validation_Subject_0_started_Time_1_", resourceCulture); + } + } + } +} Index: Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.resx =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.resx (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Service/Properties/Resources.resx (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Er is geen hydraulische randvoorwaarde locatie geselecteerd. + + + Berekening van '{0}' beëindigd om: {1} + + + Berekening van '{0}' gestart om: {1} + + + Validatie mislukt: {0} + + + Validatie van '{0}' beëindigd om: {1} + + + Validatie van '{0}' gestart om: {1} + + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Service/Ringtoets.Common.Service.csproj =================================================================== diff -u -r678dc8c8dbb01fd889a082ae88c9f9d42f597a10 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/Common/src/Ringtoets.Common.Service/Ringtoets.Common.Service.csproj (.../Ringtoets.Common.Service.csproj) (revision 678dc8c8dbb01fd889a082ae88c9f9d42f597a10) +++ Ringtoets/Common/src/Ringtoets.Common.Service/Ringtoets.Common.Service.csproj (.../Ringtoets.Common.Service.csproj) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -42,8 +42,14 @@ Properties\GlobalAssembly.cs + + + True + True + Resources.resx + @@ -65,6 +71,12 @@ + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + + + + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationActivityTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationActivityTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationActivityTest.cs (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,88 @@ +// 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. + +using System; +using System.Linq; +using Core.Common.Base.Service; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.GrassCoverErosionInwards.Data; + +namespace Ringtoets.GrassCoverErosionInwards.Service.Test +{ + [TestFixture] + public class GrassCoverErosionInwardsCalculationActivityTest + { + [Test] + public void ParameteredConstructor_ExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + var calculation = new GrassCoverErosionInwardsCalculation(); + + // Call + var activity = new GrassCoverErosionInwardsCalculationActivity(calculation, "", failureMechanism, assessmentSectionMock); + + // Assert + Assert.IsInstanceOf(activity); + Assert.AreEqual(calculation.Name, activity.Name); + Assert.IsNull(activity.ProgressText); + Assert.AreEqual(ActivityState.None, activity.State); + + mocks.VerifyAll(); + } + + [Test] + public void Run_InvalidGrassCoverErosionInwardsCalculation_LogValidationStartAndEndWithError() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + var calculation = new GrassCoverErosionInwardsCalculation(); + + var activity = new GrassCoverErosionInwardsCalculationActivity(calculation, "", failureMechanism, assessmentSectionMock); + + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(3, msgs.Length); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith("Validatie mislukt: ", msgs[1]); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[2]); + }); + Assert.AreEqual(ActivityState.Failed, activity.State); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,116 @@ +// 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. + +using System; +using System.Linq; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.HydraRing.Data; + +namespace Ringtoets.GrassCoverErosionInwards.Service.Test +{ + [TestFixture] + public class GrassCoverErosionInwardsCalculationServiceTest + { + [Test] + public void Validate_Always_LogStartAndEndOfValidatingInputs() + { + // Setup + const string name = ""; + + GrassCoverErosionInwardsCalculation heightStructuresCalculation = new GrassCoverErosionInwardsCalculation + { + Name = name + }; + + // Call + Action call = () => GrassCoverErosionInwardsCalculationService.Validate(heightStructuresCalculation); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", name), msgs.First()); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", name), msgs.Last()); + }); + } + + [Test] + public void Validate_InValidCalculationInput_LogsErrorAndReturnsFalse() + { + // Setup + const string name = ""; + + GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation + { + Name = name + }; + + + // Call + bool isValid = false; + Action call = () => isValid = GrassCoverErosionInwardsCalculationService.Validate(calculation); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(3, msgs.Length); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", name), msgs.First()); + StringAssert.StartsWith("Validatie mislukt: Er is geen hydraulische randvoorwaarde locatie geselecteerd.", msgs[1]); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", name), msgs.Last()); + }); + Assert.IsFalse(isValid); + } + + [Test] + public void Validate_ValidCalculationInput_ReturnsTrue() + { + // Setup + const string name = ""; + + GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation + { + Name = name, + InputParameters = + { + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2) + } + }; + + + // Call + bool isValid = false; + Action call = () => isValid = GrassCoverErosionInwardsCalculationService.Validate(calculation); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(2, msgs.Length); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", name), msgs.First()); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", name), msgs.Last()); + }); + Assert.IsTrue(isValid); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/Ringtoets.GrassCoverErosionInwards.Service.Test.csproj =================================================================== diff -u -r06ca0cabb87aba7708bbd17481df6587eeafab43 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/Ringtoets.GrassCoverErosionInwards.Service.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Service.Test.csproj) (revision 06ca0cabb87aba7708bbd17481df6587eeafab43) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/Ringtoets.GrassCoverErosionInwards.Service.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Service.Test.csproj) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -37,17 +37,54 @@ pdbonly + + ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll + True + + + Copying.licenseheader + + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + + + {D749EE4C-CE50-4C17-BF01-9A953028C126} + Core.Common.TestUtil + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + + + {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2} + Ringtoets.HydraRing.Data + + + {90DE728E-48EF-4665-AB38-3D88E41D9F4D} + Ringtoets.GrassCoverErosionInwards.Data + + + {5D158D8E-A5EB-489C-A885-87E13BC0D3B3} + Ringtoets.GrassCoverErosionInwards.Service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Hoogte kunstwerk '{0}' niet gelukt. + + \ No newline at end of file Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj =================================================================== diff -u -r71220a7a639b250a285a87192661f1b86ff8e767 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj (.../Ringtoets.HeightStructures.Service.csproj) (revision 71220a7a639b250a285a87192661f1b86ff8e767) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Service/Ringtoets.HeightStructures.Service.csproj (.../Ringtoets.HeightStructures.Service.csproj) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -2,7 +2,7 @@ - {20DD96D3-001E-407A-AE2E-432887088F1F} + {20DD96D3-001E-407A-AE2E-432887088F1F} Library Properties Ringtoets.HeightStructures.Service @@ -32,27 +32,72 @@ AllRules.ruleset + + ..\..\..\..\packages\log4net.2.0.4\lib\net40-full\log4net.dll + True + Properties\GlobalAssembly.cs + + + + True + True + Resources.resx + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + False + {c90b77da-e421-43cc-b82e-529651bc21ac} Core.Common.Version False + + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} + Ringtoets.Common.Data + + + {D951D6DA-FE83-4920-9FDB-63BF96480B54} + Ringtoets.Common.Service + + + {888D4097-8BC2-4703-9FB1-8744C94D525E} + Ringtoets.HydraRing.Calculation + + + {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} + Ringtoets.HydraRing.Data + False + + + {1C0017D8-35B5-4CA0-8FC7-A83F46DBDC99} + Ringtoets.HeightStructures.Data + Copying.licenseheader + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rf5ed0a2ad860787e42f81146b5b5d768d99adace -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision f5ed0a2ad860787e42f81146b5b5d768d99adace) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -43,7 +43,6 @@ using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.Plugin; -using Ringtoets.HeightStructures.Plugin.Properties; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using HeightStructuresFormsResources = Ringtoets.HeightStructures.Forms.Properties.Resources; @@ -462,9 +461,12 @@ // Then TestHelper.AssertLogMessages(action, messages => { - var msgs = messages.GetEnumerator(); - Assert.IsTrue(msgs.MoveNext()); - StringAssert.StartsWith("Er is een fout opgetreden tijdens de berekening.", msgs.Current); + var msgs = messages.ToArray(); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith(String.Format("Hoogte kunstwerk '{0}' niet gelukt.", calculation.Name), msgs[3]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[4]); }); Assert.IsNull(calculation.Output); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rf5ed0a2ad860787e42f81146b5b5d768d99adace -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision f5ed0a2ad860787e42f81146b5b5d768d99adace) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -40,7 +40,6 @@ using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.Plugin; -using Ringtoets.HeightStructures.Plugin.Properties; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; @@ -604,11 +603,19 @@ var messageList = messages.ToList(); // Assert - Assert.AreEqual(4, messageList.Count); - Assert.AreEqual("Er is een fout opgetreden tijdens de berekening.", messageList[0]); - Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[1]); - Assert.AreEqual("Er is een fout opgetreden tijdens de berekening.", messageList[2]); - Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[3]); + Assert.AreEqual(12, messageList.Count); + StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]); + StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]); + StringAssert.StartsWith("Berekening van 'A' gestart om: ", messageList[2]); + Assert.AreEqual("Hoogte kunstwerk 'A' niet gelukt.", messageList[3]); + StringAssert.StartsWith("Berekening van 'A' beëindigd om: ", messageList[4]); + StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[5]); + StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[6]); + StringAssert.StartsWith("Berekening van 'B' gestart om: ", messageList[7]); + Assert.AreEqual("Hoogte kunstwerk 'B' niet gelukt.", messageList[8]); + StringAssert.StartsWith("Berekening van 'B' beëindigd om: ", messageList[9]); + Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[10]); + Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[11]); }); mocks.VerifyAll(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -rf5ed0a2ad860787e42f81146b5b5d768d99adace -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision f5ed0a2ad860787e42f81146b5b5d768d99adace) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/TreeNodeInfos/HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../HeightStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -40,7 +40,6 @@ using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; using Ringtoets.HeightStructures.Plugin; -using Ringtoets.HeightStructures.Plugin.Properties; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -586,11 +585,19 @@ var messageList = messages.ToList(); // Assert - Assert.AreEqual(4, messageList.Count); - Assert.AreEqual("Er is een fout opgetreden tijdens de berekening.", messageList[0]); - Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[1]); - Assert.AreEqual("Er is een fout opgetreden tijdens de berekening.", messageList[2]); - Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[3]); + Assert.AreEqual(12, messageList.Count); + StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]); + StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]); + StringAssert.StartsWith("Berekening van 'A' gestart om: ", messageList[2]); + Assert.AreEqual("Hoogte kunstwerk 'A' niet gelukt.", messageList[3]); + StringAssert.StartsWith("Berekening van 'A' beëindigd om: ", messageList[4]); + StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[5]); + StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[6]); + StringAssert.StartsWith("Berekening van 'B' gestart om: ", messageList[7]); + Assert.AreEqual("Hoogte kunstwerk 'B' niet gelukt.", messageList[8]); + StringAssert.StartsWith("Berekening van 'B' beëindigd om: ", messageList[9]); + Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[10]); + Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[11]); }); mocksRepository.VerifyAll(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationActivityIntegrationTest.cs (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,239 @@ +// 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. + +using System; +using System.IO; +using System.Linq; +using Core.Common.Base; +using Core.Common.Base.Geometry; +using Core.Common.Base.Service; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.HeightStructures.Data; +using Ringtoets.HeightStructures.Service; +using Ringtoets.HydraRing.Data; +using Ringtoets.Integration.Data; +using Ringtoets.Integration.Plugin.FileImporters; + +namespace Ringtoets.HeightStructures.Integration.Test +{ + [TestFixture] + public class HeightStructuresCalculationActivityIntegrationTest + { + private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HeightStructures.Integration, "HeightStructuresCalculation"); + + [Test] + public void Run_ValidHeightStructuresCalculation_PerformHeightStructuresValidationAndCalculationAndLogStartAndEnd() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + + var failureMechanism = new HeightStructuresFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("test section", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + })); + + var calculation = new HeightStructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001) + } + }; + + var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); + + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(4, msgs.Length); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[3]); + }); + Assert.AreEqual(ActivityState.Executed, activity.State); + } + + [Test] + public void Run_InValidHeightStructuresCalculationAndRan_PerformHeightStructuresValidationAndCalculationAndLogStartAndEndAndError() + { + // Setup + var mocks = new MockRepository(); + var observerMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + + var failureMechanism = new HeightStructuresFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("test section", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + })); + + var calculation = new HeightStructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) + } + }; + + calculation.Attach(observerMock); + + var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); + + // Call + Action call = () => activity.Run(); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(5, msgs.Length); + StringAssert.StartsWith(String.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(String.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith(String.Format("Hoogte kunstwerk '{0}' niet gelukt.", calculation.Name), msgs[3]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[4]); + }); + Assert.AreEqual(ActivityState.Failed, activity.State); + mocks.VerifyAll(); + } + + [Test] + public void Finish_ValidHeightStructuresCalculationAndRan_SetsOutputAndNotifyObserversOfHeightStructuresCalculation() + { + // Setup + var mocks = new MockRepository(); + var observerMock = mocks.StrictMock(); + observerMock.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + + var failureMechanism = new HeightStructuresFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("test section", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + })); + + var calculation = new HeightStructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001) + } + }; + + calculation.Attach(observerMock); + + var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); + + activity.Run(); + + // Call + activity.Finish(); + + // Assert + Assert.IsNotNull(calculation.Output); + mocks.VerifyAll(); + } + + [Test] + public void Finish_InValidHeightStructuresCalculationAndRan_DoesNotSetOutputAndDoesNotNotifyObserversOfHeightStructuresCalculation() + { + // Setup + var mocks = new MockRepository(); + var observerMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + + var failureMechanism = new HeightStructuresFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("test section", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + })); + + var calculation = new HeightStructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) + } + }; + + calculation.Attach(observerMock); + + var activity = new HeightStructuresCalculationActivity(calculation, testDataPath, failureMechanism, assessmentSection); + + activity.Run(); + + // Call + activity.Finish(); + + // Assert + Assert.IsNull(calculation.Output); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationServiceIntegrationTest.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationServiceIntegrationTest.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/HeightStructuresCalculationServiceIntegrationTest.cs (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -0,0 +1,135 @@ +// 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. + +using System; +using System.IO; +using System.Linq; +using Core.Common.Base.Geometry; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.HeightStructures.Data; +using Ringtoets.HeightStructures.Service; +using Ringtoets.HydraRing.Calculation.Data.Output; +using Ringtoets.HydraRing.Data; +using Ringtoets.Integration.Data; +using Ringtoets.Integration.Plugin.FileImporters; + +namespace Ringtoets.HeightStructures.Integration.Test +{ + [TestFixture] + public class HeightStructuresCalculationServiceIntegrationTest + { + private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HeightStructures.Integration, "HeightStructuresCalculation"); + + [Test] + public void Calculate_ValidCalculation_LogStartAndEndAndReturnOutput() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + + var failureMechanism = new HeightStructuresFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("test section", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + })); + + var calculation = new HeightStructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First(hl => hl.Id == 1300001) + } + }; + + var failureMechanismSection = failureMechanism.Sections.First(); + ExceedanceProbabilityCalculationOutput output = null; + + // Call + Action call = () => output = HeightStructuresCalculationService.Calculate(calculation, testDataPath, failureMechanismSection, failureMechanismSection.Name, failureMechanism.GeneralInput); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(2, msgs.Length); + StringAssert.StartsWith(String.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + }); + Assert.IsNotNull(output); + } + + [Test] + public void Calculate_InvalidCalculation_LogStartAndEndAndErrorMessageAndReturnNull() + { + // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + + string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); + + using (var importer = new HydraulicBoundaryDatabaseImporter()) + { + importer.Import(assessmentSection, validFilePath); + } + + var failureMechanism = new HeightStructuresFailureMechanism(); + failureMechanism.AddSection(new FailureMechanismSection("test section", new[] + { + new Point2D(0, 0), + new Point2D(1, 1) + })); + + var calculation = new HeightStructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) + } + }; + + var failureMechanismSection = failureMechanism.Sections.First(); + ExceedanceProbabilityCalculationOutput output = null; + + // Call + Action call = () => output = HeightStructuresCalculationService.Calculate(calculation, testDataPath, failureMechanismSection, failureMechanismSection.Name, failureMechanism.GeneralInput); + + // Assert + TestHelper.AssertLogMessages(call, messages => + { + var msgs = messages.ToArray(); + Assert.AreEqual(3, msgs.Length); + StringAssert.StartsWith(String.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[0]); + StringAssert.StartsWith(String.Format("Hoogte kunstwerk '{0}' niet gelukt.", calculation.Name), msgs[1]); + StringAssert.StartsWith(String.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[2]); + }); + Assert.IsNull(output); + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/Ringtoets.HeightStructures.Integration.Test.csproj =================================================================== diff -u -r5150f97d1c5e019d39723b22ff200e48b2112e71 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/Ringtoets.HeightStructures.Integration.Test.csproj (.../Ringtoets.HeightStructures.Integration.Test.csproj) (revision 5150f97d1c5e019d39723b22ff200e48b2112e71) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Integration.Test/Ringtoets.HeightStructures.Integration.Test.csproj (.../Ringtoets.HeightStructures.Integration.Test.csproj) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -37,10 +37,18 @@ pdbonly + + ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + + + ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll + + + @@ -49,6 +57,44 @@ + + + {3BBFD65B-B277-4E50-AE6D-BD24C3434609} + Core.Common.Base + + + {D749EE4C-CE50-4C17-BF01-9A953028C126} + Core.Common.TestUtil + + + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} + Ringtoets.Common.Data + + + {888d4097-8bc2-4703-9fb1-8744c94d525e} + Ringtoets.HydraRing.Calculation + + + {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} + Ringtoets.HydraRing.Data + + + {11F1F874-45AF-43E4-8AE5-15A5C9593E28} + Ringtoets.Integration.Data + + + {C8383B76-B3F1-4E6E-B56C-527B469FA20A} + Ringtoets.Integration.Plugin + + + {1C0017D8-35B5-4CA0-8FC7-A83F46DBDC99} + Ringtoets.HeightStructures.Data + + + {20DD96D3-001E-407A-AE2E-432887088F1F} + Ringtoets.HeightStructures.Service + + + \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/ExceedanceProbabilityCalculationActivityTest.cs =================================================================== diff -u -rb2ad6c7d0227c965485ec4d6f8a98f7a49a59951 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/ExceedanceProbabilityCalculationActivityTest.cs (.../ExceedanceProbabilityCalculationActivityTest.cs) (revision b2ad6c7d0227c965485ec4d6f8a98f7a49a59951) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/ExceedanceProbabilityCalculationActivityTest.cs (.../ExceedanceProbabilityCalculationActivityTest.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -55,54 +55,6 @@ } [Test] - public void Run_ExceedanceProbabilityCalculationActivity_PerformCalculationCalledWithCorrectParameters() - { - // Setup - var mocks = new MockRepository(); - var hydraRingCalculationService = mocks.StrictMock(); - var exceedanceProbabilityCalculationOutput = mocks.StrictMock(1,2, 3, 5, 6, 7, 8, 9, 9.9); - var exceedanceProbabilityCalculationInput = mocks.StrictMock(10000); - - const string hlcdDirectory = "hlcdDirectory"; - const string ringId = "ringId"; - const HydraRingUncertaintiesType uncertaintiesType = HydraRingUncertaintiesType.All; - const HydraRingTimeIntegrationSchemeType timeIntegrationSchemeType = HydraRingTimeIntegrationSchemeType.FBC; - - hydraRingCalculationService.Expect(hcs => hcs.PerformCalculation(hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType, exceedanceProbabilityCalculationInput)).Return(exceedanceProbabilityCalculationOutput); - - mocks.ReplayAll(); - - var activity = new ExceedanceProbabilityCalculationActivity("Name of activity", hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType, exceedanceProbabilityCalculationInput, null, null, hydraRingCalculationService); - - // Call - activity.Run(); - - // Assert - mocks.VerifyAll(); - } - - [Test] - public void Cancel_ExceedanceProbabilityCalculationActivity_CancelRunningCalculationCalled() - { - // Setup - var mocks = new MockRepository(); - var hydraRingCalculationService = mocks.StrictMock(); - var exceedanceProbabilityCalculationInput = mocks.StrictMock(10000); - - hydraRingCalculationService.Expect(hcs => hcs.CancelRunningCalculation()); - - mocks.ReplayAll(); - - var activity = new ExceedanceProbabilityCalculationActivity("Name of activity", "hlcdDirectory", "ringId", HydraRingTimeIntegrationSchemeType.FBC, HydraRingUncertaintiesType.All, exceedanceProbabilityCalculationInput, null, null, hydraRingCalculationService); - - // Call - activity.Cancel(); - - // Assert - mocks.VerifyAll(); - } - - [Test] public void Run_Always_BeforeRunActionPerformedAsExpected() { // Setup Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/TargetProbabilityCalculationActivityTest.cs =================================================================== diff -u -rb2ad6c7d0227c965485ec4d6f8a98f7a49a59951 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/TargetProbabilityCalculationActivityTest.cs (.../TargetProbabilityCalculationActivityTest.cs) (revision b2ad6c7d0227c965485ec4d6f8a98f7a49a59951) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Activities/TargetProbabilityCalculationActivityTest.cs (.../TargetProbabilityCalculationActivityTest.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -54,55 +54,55 @@ Assert.AreEqual(ActivityState.None, activity.State); } - [Test] - public void Run_TargetProbabilityCalculationActivity_PerformCalculationCalledWithCorrectParameters() - { - // Setup - var mocks = new MockRepository(); - var hydraRingCalculationService = mocks.StrictMock(); - var targetProbabilityCalculationOutput = mocks.StrictMock(1.1, 2.2); - var targetProbabilityCalculationInput = mocks.StrictMock(1, 10000); +// [Test] +// public void Run_TargetProbabilityCalculationActivity_PerformCalculationCalledWithCorrectParameters() +// { +// // Setup +// var mocks = new MockRepository(); +// var hydraRingCalculationService = mocks.StrictMock(); +// var targetProbabilityCalculationOutput = mocks.StrictMock(1.1, 2.2); +// var targetProbabilityCalculationInput = mocks.StrictMock(1, 10000); +// +// const string hlcdDirectory = "hlcdDirectory"; +// const string ringId = "ringId"; +// const HydraRingUncertaintiesType uncertaintiesType = HydraRingUncertaintiesType.All; +// const HydraRingTimeIntegrationSchemeType timeIntegrationSchemeType = HydraRingTimeIntegrationSchemeType.FBC; +// +// hydraRingCalculationService.Expect(hcs => hcs.PerformCalculation(hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType, targetProbabilityCalculationInput)).Return(targetProbabilityCalculationOutput); +// +// mocks.ReplayAll(); +// +// var activity = new TargetProbabilityCalculationActivity("Name of activity", hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType, targetProbabilityCalculationInput, null, null, hydraRingCalculationService); +// +// // Call +// activity.Run(); +// +// // Assert +// mocks.VerifyAll(); +// } +// +// [Test] +// public void Cancel_TargetProbabilityCalculationActivity_CancelRunningCalculationCalled() +// { +// // Setup +// var mocks = new MockRepository(); +// var hydraRingCalculationService = mocks.StrictMock(); +// var targetProbabilityCalculationInput = mocks.StrictMock(1, 10000); +// +// hydraRingCalculationService.Expect(hcs => hcs.CancelRunningCalculation()); +// +// mocks.ReplayAll(); +// +// var activity = new TargetProbabilityCalculationActivity("Name of activity", "hlcdDirectory", "ringId", HydraRingTimeIntegrationSchemeType.FBC, HydraRingUncertaintiesType.All, targetProbabilityCalculationInput, null, null, hydraRingCalculationService); +// +// // Call +// activity.Cancel(); +// +// // Assert +// mocks.VerifyAll(); +// } - const string hlcdDirectory = "hlcdDirectory"; - const string ringId = "ringId"; - const HydraRingUncertaintiesType uncertaintiesType = HydraRingUncertaintiesType.All; - const HydraRingTimeIntegrationSchemeType timeIntegrationSchemeType = HydraRingTimeIntegrationSchemeType.FBC; - - hydraRingCalculationService.Expect(hcs => hcs.PerformCalculation(hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType, targetProbabilityCalculationInput)).Return(targetProbabilityCalculationOutput); - - mocks.ReplayAll(); - - var activity = new TargetProbabilityCalculationActivity("Name of activity", hlcdDirectory, ringId, timeIntegrationSchemeType, uncertaintiesType, targetProbabilityCalculationInput, null, null, hydraRingCalculationService); - - // Call - activity.Run(); - - // Assert - mocks.VerifyAll(); - } - [Test] - public void Cancel_TargetProbabilityCalculationActivity_CancelRunningCalculationCalled() - { - // Setup - var mocks = new MockRepository(); - var hydraRingCalculationService = mocks.StrictMock(); - var targetProbabilityCalculationInput = mocks.StrictMock(1, 10000); - - hydraRingCalculationService.Expect(hcs => hcs.CancelRunningCalculation()); - - mocks.ReplayAll(); - - var activity = new TargetProbabilityCalculationActivity("Name of activity", "hlcdDirectory", "ringId", HydraRingTimeIntegrationSchemeType.FBC, HydraRingUncertaintiesType.All, targetProbabilityCalculationInput, null, null, hydraRingCalculationService); - - // Call - activity.Cancel(); - - // Assert - mocks.VerifyAll(); - } - - [Test] public void Run_Always_BeforeRunActionPerformedAsExpected() { // Setup Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj =================================================================== diff -u -rfe12df1b9f055c64ed8c26123d9c45bea6490bcc -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision fe12df1b9f055c64ed8c26123d9c45bea6490bcc) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Ringtoets.HydraRing.Calculation.Test.csproj (.../Ringtoets.HydraRing.Calculation.Test.csproj) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -75,7 +75,6 @@ - Fisheye: Tag e568165b751acf8d72cdf0d128f76d7792dadb56 refers to a dead (removed) revision in file `Ringtoets/HydraRing/test/Ringtoets.HydraRing.Calculation.Test/Services/HydraRingCalculationServiceTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag e568165b751acf8d72cdf0d128f76d7792dadb56 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Service/DateTimeService.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs =================================================================== diff -u -r8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision 8832cfacbfb0a999d9dd5ddcb93fd81bdb2fb09f) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingCalculationService.cs (.../PipingCalculationService.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -22,11 +22,14 @@ using System; using System.Collections.Generic; using log4net; +using Ringtoets.Common.Service; using Ringtoets.Piping.Data; using Ringtoets.Piping.KernelWrapper; using Ringtoets.Piping.KernelWrapper.SubCalculator; using Ringtoets.Piping.Service.Properties; +using RingtoetsCommonServiceResources = Ringtoets.Common.Service.Properties.Resources; + namespace Ringtoets.Piping.Service { /// @@ -46,7 +49,7 @@ /// False if contains validation errors; True otherwise. public static bool Validate(PipingCalculation calculation) { - pipingCalculationLogger.Info(String.Format(Resources.Validation_Subject_0_started_Time_1_, + pipingCalculationLogger.Info(String.Format(RingtoetsCommonServiceResources.Validation_Subject_0_started_Time_1_, calculation.Name, DateTimeService.CurrentTimeAsString)); var inputValidationResults = ValidateInput(calculation.InputParameters); @@ -75,7 +78,7 @@ /// Consider calling first to see if calculation is possible. public static void Calculate(PipingCalculation calculation) { - pipingCalculationLogger.Info(String.Format(Resources.Calculation_Subject_0_started_Time_1_, + pipingCalculationLogger.Info(String.Format(RingtoetsCommonServiceResources.Calculation_Subject_0_started_Time_1_, calculation.Name, DateTimeService.CurrentTimeAsString)); try @@ -95,14 +98,14 @@ } finally { - pipingCalculationLogger.Info(String.Format(Resources.Calculation_Subject_0_ended_Time_1_, + pipingCalculationLogger.Info(String.Format(RingtoetsCommonServiceResources.Calculation_Subject_0_ended_Time_1_, calculation.Name, DateTimeService.CurrentTimeAsString)); } } private static void LogValidationEndTime(PipingCalculation calculation) { - pipingCalculationLogger.Info(String.Format(Resources.Validation_Subject_0_ended_Time_1_, + pipingCalculationLogger.Info(String.Format(RingtoetsCommonServiceResources.Validation_Subject_0_ended_Time_1_, calculation.Name, DateTimeService.CurrentTimeAsString)); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/Properties/Resources.Designer.cs =================================================================== diff -u -r420c266df87245b9471d3794ef5043ee89cb482a -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/Piping/src/Ringtoets.Piping.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 420c266df87245b9471d3794ef5043ee89cb482a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -61,24 +61,6 @@ } /// - /// Looks up a localized string similar to Berekening van '{0}' beëindigd om: {1}. - /// - internal static string Calculation_Subject_0_ended_Time_1_ { - get { - return ResourceManager.GetString("Calculation_Subject_0_ended_Time_1_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Berekening van '{0}' gestart om: {1}. - /// - internal static string Calculation_Subject_0_started_Time_1_ { - get { - return ResourceManager.GetString("Calculation_Subject_0_started_Time_1_", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Piping berekening niet gelukt: {0}. /// internal static string Error_in_piping_calculation_0 { @@ -113,23 +95,5 @@ return ResourceManager.GetString("PipingCalculationService_ValidateInput_Cannot_determine_thickness_coverage_layer", resourceCulture); } } - - /// - /// Looks up a localized string similar to Validatie van '{0}' beëindigd om: {1}. - /// - internal static string Validation_Subject_0_ended_Time_1_ { - get { - return ResourceManager.GetString("Validation_Subject_0_ended_Time_1_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Validatie van '{0}' gestart om: {1}. - /// - internal static string Validation_Subject_0_started_Time_1_ { - get { - return ResourceManager.GetString("Validation_Subject_0_started_Time_1_", resourceCulture); - } - } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/Properties/Resources.resx =================================================================== diff -u -r420c266df87245b9471d3794ef5043ee89cb482a -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/Piping/src/Ringtoets.Piping.Service/Properties/Resources.resx (.../Resources.resx) (revision 420c266df87245b9471d3794ef5043ee89cb482a) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/Properties/Resources.resx (.../Resources.resx) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -117,24 +117,12 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Berekening van '{0}' beëindigd om: {1} - - - Berekening van '{0}' gestart om: {1} - Piping berekening niet gelukt: {0} Validatie mislukt: {0} - - Validatie van '{0}' beëindigd om: {1} - - - Validatie van '{0}' gestart om: {1} - Kan de dikte van het watervoerend pakket niet afleiden op basis van de invoer. Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/Ringtoets.Piping.Service.csproj =================================================================== diff -u -r80c86231452b9beb7e8b8eba3698ceb9c0551de3 -re568165b751acf8d72cdf0d128f76d7792dadb56 --- Ringtoets/Piping/src/Ringtoets.Piping.Service/Ringtoets.Piping.Service.csproj (.../Ringtoets.Piping.Service.csproj) (revision 80c86231452b9beb7e8b8eba3698ceb9c0551de3) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/Ringtoets.Piping.Service.csproj (.../Ringtoets.Piping.Service.csproj) (revision e568165b751acf8d72cdf0d128f76d7792dadb56) @@ -54,7 +54,6 @@ Properties\GlobalAssembly.cs - @@ -83,6 +82,10 @@ Ringtoets.Common.Data False + + {D951D6DA-FE83-4920-9FDB-63BF96480B54} + Ringtoets.Common.Service + {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} Ringtoets.HydraRing.Data