Index: Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj =================================================================== diff -u -r90f09f42b0e182615dba7007fc5866d90a92b605 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 90f09f42b0e182615dba7007fc5866d90a92b605) +++ Core/Common/src/Core.Common.Utils/Core.Common.Utils.csproj (.../Core.Common.Utils.csproj) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -74,12 +74,17 @@ ..\..\..\..\packages\log4net.2.0.4\lib\net40-full\log4net.dll True + + ..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll + True + 3.5 + @@ -112,6 +117,7 @@ + Index: Core/Common/src/Core.Common.Utils/StatisticsConverter.cs =================================================================== diff -u --- Core/Common/src/Core.Common.Utils/StatisticsConverter.cs (revision 0) +++ Core/Common/src/Core.Common.Utils/StatisticsConverter.cs (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -0,0 +1,41 @@ +// 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 Lesser 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 MathNet.Numerics.Distributions; + +namespace Core.Common.Utils +{ + /// + /// This class contains a converter related to the statistics domain. + /// + public static class StatisticsConverter + { + /// + /// Calculates the probability from a norm. + /// + /// The norm to convert. + /// The probability. + public static double NormToBeta(double norm) + { + return -Normal.InvCDF(0.0, 1.0, 1.0 / norm); + } + } +} \ No newline at end of file Index: Core/Common/src/Core.Common.Utils/packages.config =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Core/Common/src/Core.Common.Utils/packages.config (.../packages.config) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Core/Common/src/Core.Common.Utils/packages.config (.../packages.config) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -24,4 +24,5 @@ --> + Index: Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj =================================================================== diff -u -ra4eed06be1ec058f2dea53b95ec62e3380ed75c5 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj (.../Core.Common.Utils.Test.csproj) (revision a4eed06be1ec058f2dea53b95ec62e3380ed75c5) +++ Core/Common/test/Core.Common.Utils.Test/Core.Common.Utils.Test.csproj (.../Core.Common.Utils.Test.csproj) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -97,6 +97,7 @@ + Index: Core/Common/test/Core.Common.Utils.Test/StatisticsConverterTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Utils.Test/StatisticsConverterTest.cs (revision 0) +++ Core/Common/test/Core.Common.Utils.Test/StatisticsConverterTest.cs (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -0,0 +1,35 @@ +// 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 Lesser 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 Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser 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 NUnit.Framework; + +namespace Core.Common.Utils.Test +{ + [TestFixture] + public class StatisticsConverterTest + { + [Test] + public void NormToBeta_ConvertNorm_CorrectBeta() + { + Assert.AreEqual(-1.335177736, StatisticsConverter.NormToBeta(1.1), 1.0e-8); + } + } +} \ No newline at end of file Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/TargetProbabilityCalculationInput.cs =================================================================== diff -u -r5e6eacaf76f765ba77febee673e9e94895e46feb -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/TargetProbabilityCalculationInput.cs (.../TargetProbabilityCalculationInput.cs) (revision 5e6eacaf76f765ba77febee673e9e94895e46feb) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Data/Input/TargetProbabilityCalculationInput.cs (.../TargetProbabilityCalculationInput.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using MathNet.Numerics.Distributions; +using Core.Common.Utils; namespace Ringtoets.HydraRing.Calculation.Data.Input { @@ -39,7 +39,7 @@ /// As a part of the constructor, the is automatically converted into a reliability index. protected TargetProbabilityCalculationInput(long hydraulicBoundaryLocationId, double norm) : base(hydraulicBoundaryLocationId) { - beta = -Normal.InvCDF(0.0, 1.0, 1.0/norm); + beta = StatisticsConverter.NormToBeta(norm); } public override int CalculationTypeId Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj =================================================================== diff -u -rc7843d3b8c846c4aab66ba32e67f883b6555932b -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision c7843d3b8c846c4aab66ba32e67f883b6555932b) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Ringtoets.HydraRing.Calculation.csproj (.../Ringtoets.HydraRing.Calculation.csproj) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -110,6 +110,10 @@ Core.Common.Base False + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Utils + {c90b77da-e421-43cc-b82e-529651bc21ac} Core.Common.Version Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs =================================================================== diff -u -r7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -82,6 +82,16 @@ /// public long StorageId { get; set; } + /// + /// Gets or sets the convergence status of the design waterlevel calculation. + /// + public bool DesignWaterLevelCalculationConvergence { get; set; } + + /// + /// Gets sets the convergence status of the waveheight calculation. + /// + public bool WaveHeightCalculationConvergence { get; set; } + public override string ToString() { return Name; Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs =================================================================== diff -u -r6fc38f8582161da49669e8785efa98ad32cc02ae -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 6fc38f8582161da49669e8785efa98ad32cc02ae) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -62,6 +62,8 @@ Assert.AreEqual(y, location.Y); Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); + Assert.IsFalse(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); + Assert.IsFalse(hydraulicBoundaryLocation.WaveHeightCalculationConvergence); } [Test] Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r7be0d1a56ae574fda540c06b808e017ad7695e90 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7be0d1a56ae574fda540c06b808e017ad7695e90) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -394,6 +394,42 @@ } /// + /// Looks up a localized string similar to Convergentie status van de toetspeil berekening.. + /// + public static string HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_Description { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Convergentie. + /// + public static string HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_DisplayName { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Convergentie status van de golfhoogte berekening.. + /// + public static string HydraulicBoundaryDatabase_Convergence_WaveHeight_Description { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Convergence_WaveHeight_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Convergentie. + /// + public static string HydraulicBoundaryDatabase_Convergence_WaveHeight_DisplayName { + get { + return ResourceManager.GetString("HydraulicBoundaryDatabase_Convergence_WaveHeight_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Hydraulische randvoorwaarden. /// public static string HydraulicBoundaryDatabase_DisplayName { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r7be0d1a56ae574fda540c06b808e017ad7695e90 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 7be0d1a56ae574fda540c06b808e017ad7695e90) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -329,4 +329,16 @@ De berekende toetspeilen en golfhoogtes van alle hydraulische randvoorwaarden locaties zijn verwijderd. + + Convergentie status van de toetspeil berekening. + + + Convergentie + + + Convergentie status van de golfhoogte berekening. + + + Convergentie + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationDesignWaterLevelProperties.cs =================================================================== diff -u -r9663b036afafe1a23c75ade5af7318830c10d408 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationDesignWaterLevelProperties.cs (.../HydraulicBoundaryLocationDesignWaterLevelProperties.cs) (revision 9663b036afafe1a23c75ade5af7318830c10d408) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationDesignWaterLevelProperties.cs (.../HydraulicBoundaryLocationDesignWaterLevelProperties.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -74,5 +74,18 @@ return double.IsNaN(data.DesignWaterLevel) ? string.Empty : data.DesignWaterLevel.ToString("F2", CultureInfo.InvariantCulture); } } + + /// + /// Gets the convergence status of the designwaterlevel calculation. + /// + [PropertyOrder(5)] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_Description")] + public bool Convergence { + get + { + return data.DesignWaterLevelCalculationConvergence; + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationWaveHeightProperties.cs =================================================================== diff -u -r9663b036afafe1a23c75ade5af7318830c10d408 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationWaveHeightProperties.cs (.../HydraulicBoundaryLocationWaveHeightProperties.cs) (revision 9663b036afafe1a23c75ade5af7318830c10d408) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationWaveHeightProperties.cs (.../HydraulicBoundaryLocationWaveHeightProperties.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -74,5 +74,19 @@ return double.IsNaN(data.WaveHeight) ? string.Empty : data.WaveHeight.ToString("F2", CultureInfo.InvariantCulture); } } + + /// + /// Gets the convergence status of the waveheight calculation. + /// + [PropertyOrder(5)] + [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Convergence_WaveHeight_DisplayName")] + [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Convergence_WaveHeight_Description")] + public bool Convergence + { + get + { + return data.WaveHeightCalculationConvergence; + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs =================================================================== diff -u -rae8fcc01cc86ea85efeaf5ff31cde9a650a90df5 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision ae8fcc01cc86ea85efeaf5ff31cde9a650a90df5) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -21,6 +21,7 @@ using System; using Core.Common.Base.Service; +using Core.Common.Utils; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HydraRing.Calculation.Activities; using Ringtoets.HydraRing.Calculation.Data.Output; @@ -88,6 +89,8 @@ PerformFinish(() => { hydraulicBoundaryLocation.DesignWaterLevel = Output.Result; + hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = + Math.Abs(Output.ActualTargetProbability - StatisticsConverter.NormToBeta(assessmentSection.FailureMechanismContribution.Norm)) <= 10e-5; }); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs =================================================================== diff -u -rec26e8cc8a4c043cfec1884597d87b3c2d81d059 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision ec26e8cc8a4c043cfec1884597d87b3c2d81d059) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -21,6 +21,7 @@ using System; using Core.Common.Base.Service; +using Core.Common.Utils; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HydraRing.Calculation.Activities; using Ringtoets.HydraRing.Calculation.Data.Output; @@ -85,7 +86,13 @@ protected override void OnFinish() { - PerformFinish(() => { hydraulicBoundaryLocation.WaveHeight = Output.Result; }); + PerformFinish(() => + { + hydraulicBoundaryLocation.WaveHeight = Output.Result; + var waveHeightCalculationConvergence = Math.Abs(Output.ActualTargetProbability - StatisticsConverter.NormToBeta(assessmentSection.FailureMechanismContribution.Norm)) <= 10e-5; + hydraulicBoundaryLocation.WaveHeightCalculationConvergence = + waveHeightCalculationConvergence; + }); hydraulicBoundaryLocation.NotifyObservers(); } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationDesignWaterLevelPropertiesTest.cs =================================================================== diff -u -r9663b036afafe1a23c75ade5af7318830c10d408 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationDesignWaterLevelPropertiesTest.cs (.../HydraulicBoundaryLocationDesignWaterLevelPropertiesTest.cs) (revision 9663b036afafe1a23c75ade5af7318830c10d408) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationDesignWaterLevelPropertiesTest.cs (.../HydraulicBoundaryLocationDesignWaterLevelPropertiesTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -57,6 +57,7 @@ Point2D coordinates = new Point2D(x, y); Assert.AreEqual(coordinates, properties.Location); Assert.AreEqual(string.Empty, properties.DesignWaterLevel); + Assert.IsFalse(properties.Convergence); } [Test] @@ -88,6 +89,7 @@ Assert.AreEqual(coordinates, properties.Location); string expectedDesignWaterLevel = designWaterLevel.ToString("F2", CultureInfo.InvariantCulture); Assert.AreEqual(expectedDesignWaterLevel, properties.DesignWaterLevel); + Assert.IsFalse(properties.Convergence); } [Test] @@ -111,16 +113,19 @@ const string expectedNameDisplayName = "Naam"; const string expectedLocationDisplayName = "Coördinaten [m]"; const string expectedDesignWaterLevelDisplayName = "Toetspeil [m+NAP]"; + const string expectedConvergenceDisplayName = "Convergentie"; const string expectedIdDescription = "ID van de hydraulische randvoorwaardenlocatie in de database."; const string expectedNameDescription = "Naam van de hydraulische randvoorwaardenlocatie."; const string expectedLocationDescription = "Coördinaten van de hydraulische randvoorwaardenlocatie."; const string expectedDesignWaterLevelDescription = "Berekend toetspeil."; + const string expectedConvergenceDisplayDescription = "Convergentie status van de toetspeil berekening."; PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); PropertyDescriptor idProperty = dynamicProperties.Find("Id", false); PropertyDescriptor nameProperty = dynamicProperties.Find("Name", false); PropertyDescriptor locationProperty = dynamicProperties.Find("Location", false); PropertyDescriptor designWaterLevelProperty = dynamicProperties.Find("DesignWaterLevel", false); + PropertyDescriptor convergenceProperty = dynamicProperties.Find("Convergence", false); Assert.IsInstanceOf(classTypeConverter); @@ -155,6 +160,13 @@ Assert.AreEqual(expectedDesignWaterLevelDisplayName, designWaterLevelProperty.DisplayName); Assert.AreEqual(expectedDesignWaterLevelDescription, designWaterLevelProperty.Description); Assert.AreEqual(4, designWaterLevelProperty.Attributes.OfType().First().Order); + + Assert.IsNotNull(convergenceProperty); + Assert.IsTrue(convergenceProperty.IsReadOnly); + Assert.IsTrue(convergenceProperty.IsBrowsable); + Assert.AreEqual(expectedConvergenceDisplayName, convergenceProperty.DisplayName); + Assert.AreEqual(expectedConvergenceDisplayDescription, convergenceProperty.Description); + Assert.AreEqual(5, convergenceProperty.Attributes.OfType().First().Order); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationWaveHeightPropertiesTest.cs =================================================================== diff -u -r9663b036afafe1a23c75ade5af7318830c10d408 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationWaveHeightPropertiesTest.cs (.../HydraulicBoundaryLocationWaveHeightPropertiesTest.cs) (revision 9663b036afafe1a23c75ade5af7318830c10d408) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationWaveHeightPropertiesTest.cs (.../HydraulicBoundaryLocationWaveHeightPropertiesTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -57,6 +57,7 @@ Point2D coordinates = new Point2D(x, y); Assert.AreEqual(coordinates, properties.Location); Assert.AreEqual(string.Empty, properties.WaveHeight); + Assert.IsFalse(properties.Convergence); } [Test] @@ -87,6 +88,7 @@ Assert.AreEqual(coordinates, properties.Location); string expectedWaveHeight = waveHeight.ToString("F2", CultureInfo.InvariantCulture); Assert.AreEqual(expectedWaveHeight, properties.WaveHeight); + Assert.IsFalse(properties.Convergence); } [Test] @@ -109,15 +111,19 @@ const string expectedNameDisplayName = "Naam"; const string expectedLocationDisplayName = "Coördinaten [m]"; const string expectedWaveHeightDisplayName = "Hs [m]"; + const string expectedConvergenceDisplayName = "Convergentie"; const string expectedIdDescription = "ID van de hydraulische randvoorwaardenlocatie in de database."; const string expectedNameDescription = "Naam van de hydraulische randvoorwaardenlocatie."; const string expectedLocationDescription = "Coördinaten van de hydraulische randvoorwaardenlocatie."; const string expectedWaveHeightDescription = "Berekende golfhoogte."; + const string expectedConvergenceDisplayDescription = "Convergentie status van de golfhoogte berekening."; + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); PropertyDescriptor idProperty = dynamicProperties.Find("Id", false); PropertyDescriptor nameProperty = dynamicProperties.Find("Name", false); PropertyDescriptor locationProperty = dynamicProperties.Find("Location", false); PropertyDescriptor waveHeightProperty = dynamicProperties.Find("WaveHeight", false); + PropertyDescriptor convergenceProperty = dynamicProperties.Find("Convergence", false); Assert.IsInstanceOf(classTypeConverter); @@ -152,6 +158,13 @@ Assert.AreEqual(expectedWaveHeightDisplayName, waveHeightProperty.DisplayName); Assert.AreEqual(expectedWaveHeightDescription, waveHeightProperty.Description); Assert.AreEqual(4, waveHeightProperty.Attributes.OfType().First().Order); + + Assert.IsNotNull(convergenceProperty); + Assert.IsTrue(convergenceProperty.IsReadOnly); + Assert.IsTrue(convergenceProperty.IsBrowsable); + Assert.AreEqual(expectedConvergenceDisplayName, convergenceProperty.DisplayName); + Assert.AreEqual(expectedConvergenceDisplayDescription, convergenceProperty.Description); + Assert.AreEqual(5, convergenceProperty.Attributes.OfType().First().Order); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs =================================================================== diff -u -rbe66e1bec38a780abb27fedea8632acf4d24a173 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision be66e1bec38a780abb27fedea8632acf4d24a173) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -230,7 +230,7 @@ } [Test] - public void Finish_ValidCalculationAndRun_SetsDesignWaterLevel() + public void Finish_ValidCalculationAndRun_SetsDesignWaterLevelAndConvergence() { // Setup var mockRepository = new MockRepository(); @@ -239,27 +239,33 @@ assessmentSectionStub.Expect(o => o.NotifyObservers()); var failureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), 30, 30000); - assessmentSectionStub.Expect(asm => asm.FailureMechanismContribution).Return(failureMechanismContribution); + assessmentSectionStub.Expect(asm => asm.FailureMechanismContribution).Return(failureMechanismContribution).Repeat.Twice(); mockRepository.ReplayAll(); ImportHydraulicBoundaryDatabase(assessmentSectionStub); var hydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations.First(loc => loc.Id == 1300001); + hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = true; var activity = new DesignWaterLevelCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation); activity.Run(); + // Precondition + Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); + // Call activity.Finish(); // Assert Assert.IsFalse(double.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel)); + Assert.IsFalse(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); mockRepository.VerifyAll(); } [Test] - public void Finish_InvalidCalculationAndRun_DoesNotSetDesignWaterlevel() + public void Finish_InvalidCalculationAndRun_DoesNotSetDesignWaterlevelAndConvergence() { // Setup var mockRepository = new MockRepository(); @@ -274,16 +280,22 @@ ImportHydraulicBoundaryDatabase(assessmentSectionStub); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1); + hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = true; var activity = new DesignWaterLevelCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation); activity.Run(); + // Precondition + Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); + // Call activity.Finish(); // Assert Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); mockRepository.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs =================================================================== diff -u -rbe66e1bec38a780abb27fedea8632acf4d24a173 -r7ec5d40014c7ff2faaba8fe3bef778a9d728cc37 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision be66e1bec38a780abb27fedea8632acf4d24a173) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 7ec5d40014c7ff2faaba8fe3bef778a9d728cc37) @@ -236,7 +236,7 @@ } [Test] - public void Finish_ValidCalculationAndRun_SetsWaveHeightAndNotifyObservers() + public void Finish_ValidCalculationAndRun_SetsPropertiesAndNotifyObservers() { // Setup var mockRepository = new MockRepository(); @@ -248,28 +248,34 @@ assessmentSectionStub.Expect(o => o.NotifyObservers()); var failureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), 30, 30000); - assessmentSectionStub.Expect(asm => asm.FailureMechanismContribution).Return(failureMechanismContribution); + assessmentSectionStub.Expect(asm => asm.FailureMechanismContribution).Return(failureMechanismContribution).Repeat.Twice(); mockRepository.ReplayAll(); ImportHydraulicBoundaryDatabase(assessmentSectionStub); var hydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations.First(loc => loc.Id == 1300001); + hydraulicBoundaryLocation.WaveHeightCalculationConvergence = true; hydraulicBoundaryLocation.Attach(observerMock); var activity = new WaveHeightCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation); activity.Run(); + // Precondition + Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); + Assert.IsTrue(hydraulicBoundaryLocation.WaveHeightCalculationConvergence); + // Call activity.Finish(); // Assert Assert.IsFalse(double.IsNaN(hydraulicBoundaryLocation.WaveHeight)); + Assert.IsFalse(hydraulicBoundaryLocation.WaveHeightCalculationConvergence); mockRepository.VerifyAll(); } [Test] - public void Finish_InvalidCalculationAndRun_DoesNotSetWaveHeightAndUpdateObserver() + public void Finish_InvalidCalculationAndRun_DoesNotSetPropertiesAndUpdateObserver() { // Setup var mockRepository = new MockRepository(); @@ -287,17 +293,23 @@ ImportHydraulicBoundaryDatabase(assessmentSectionStub); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1); + hydraulicBoundaryLocation.WaveHeightCalculationConvergence = true; hydraulicBoundaryLocation.Attach(observerMock); var activity = new WaveHeightCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation); activity.Run(); + // Precondition + Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); + Assert.IsTrue(hydraulicBoundaryLocation.WaveHeightCalculationConvergence); + // Call activity.Finish(); // Assert Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); + Assert.IsTrue(hydraulicBoundaryLocation.WaveHeightCalculationConvergence); mockRepository.VerifyAll(); }