Index: Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs =================================================================== diff -u -r2ff2a985fe9015df6da49fe43006e5c7631434c3 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d --- Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs (.../FailureMechanismContribution.cs) (revision 2ff2a985fe9015df6da49fe43006e5c7631434c3) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs (.../FailureMechanismContribution.cs) (revision 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d) @@ -77,7 +77,7 @@ { if (double.IsNaN(value) || value < 0.0 || value > 1.0) { - throw new ArgumentOutOfRangeException("value", Resources.FailureMechanismContributionItem_Norm_must_be_larger_than_zero); + throw new ArgumentOutOfRangeException("value", Resources.Probability_Must_be_in_range_zero_to_one); } norm = value; distribution.ForEachElementDo(d => d.Norm = norm); Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs =================================================================== diff -u -rba3865a26a9d4893855dd528ea1ad804d1cdae61 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ba3865a26a9d4893855dd528ea1ad804d1cdae61) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d) @@ -22,7 +22,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. @@ -301,15 +301,6 @@ } /// - /// Looks up a localized string similar to De faalkansbijdrage kan alleen bepaald worden als de norm van het traject groter is dan 0.. - /// - public static string FailureMechanismContributionItem_Norm_must_be_larger_than_zero { - get { - return ResourceManager.GetString("FailureMechanismContributionItem_Norm_must_be_larger_than_zero", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Vak moet minstens uit één punt bestaan.. /// public static string FailureMechanismSection_Section_must_have_at_least_1_geometry_point { Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx =================================================================== diff -u -rba3865a26a9d4893855dd528ea1ad804d1cdae61 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision ba3865a26a9d4893855dd528ea1ad804d1cdae61) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d) @@ -135,9 +135,6 @@ Kan geen bijdrage element maken zonder een toetsspoor. - - De faalkansbijdrage kan alleen bepaald worden als de norm van het traject groter is dan 0. - Kan geen bijdrageoverzicht maken zonder toetsspoor. Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionTest.cs =================================================================== diff -u -r2ff2a985fe9015df6da49fe43006e5c7631434c3 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionTest.cs (.../FailureMechanismContributionTest.cs) (revision 2ff2a985fe9015df6da49fe43006e5c7631434c3) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionTest.cs (.../FailureMechanismContributionTest.cs) (revision 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d) @@ -90,7 +90,7 @@ TestDelegate test = () => new FailureMechanismContribution(Enumerable.Empty(), contribution, norm); // Assert - const string expectedMessage = "De faalkansbijdrage kan alleen bepaald worden als de norm van het traject groter is dan 0."; + const string expectedMessage = "Kans moet in het bereik [0, 1] liggen."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); } @@ -332,6 +332,24 @@ } [Test] + public void Norm_InvalidNewNorm_ThrowsArgumentOutOfRangeException( + [Values(150, 1e+6, -1e-6, -150, double.NaN)] double newNorm) + { + // Setup + var random = new Random(21); + var contribution = random.Next(1, 100); + var norm = random.NextDouble(); + var failureMechanismContribution = new FailureMechanismContribution(Enumerable.Empty(), contribution, norm); + + // Call + TestDelegate test = () => failureMechanismContribution.Norm = newNorm; + + // Assert + const string expectedMessage = "Kans moet in het bereik [0, 1] liggen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] public void Norm_WhenUpdated_NormUpdatedForEachFailureMechanismContributionItem() { // Setup Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/ReferenceLineMetaImporter/ShapeFileWithInvalidNormValue/ShapeFileWithInvalidNormValue.dbf =================================================================== diff -u -r50b203a8d5c805fc548fb6b92c70a847190da6a5 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d Binary files differ Fisheye: Tag 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/ReferenceLineMetaImporter/ShapeFileWithInvalidNormValue/ShapeFileWithInvalidNormValue.prj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/ReferenceLineMetaImporter/ShapeFileWithInvalidNormValue/ShapeFileWithInvalidNormValue.qpj'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/ReferenceLineMetaImporter/ShapeFileWithInvalidNormValue/ShapeFileWithInvalidNormValue.shp =================================================================== diff -u -r50b203a8d5c805fc548fb6b92c70a847190da6a5 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d Binary files differ Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/ReferenceLineMetaImporter/ShapeFileWithInvalidNormValue/ShapeFileWithInvalidNormValue.shx =================================================================== diff -u -r50b203a8d5c805fc548fb6b92c70a847190da6a5 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d Binary files differ Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs =================================================================== diff -u -r2ff2a985fe9015df6da49fe43006e5c7631434c3 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs (.../FailureMechanismContributionNormChangeHandler.cs) (revision 2ff2a985fe9015df6da49fe43006e5c7631434c3) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/FailureMechanismContributionNormChangeHandler.cs (.../FailureMechanismContributionNormChangeHandler.cs) (revision 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d) @@ -93,8 +93,8 @@ .OfType() .First(); - IEnumerable hydraulicBoundaryLocationAffected = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(assessmentSection.HydraulicBoundaryDatabase, - grassCoverErosionOutwardsFailureMechanism); + IEnumerable hydraulicBoundaryLocationAffected = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput( + assessmentSection.HydraulicBoundaryDatabase, grassCoverErosionOutwardsFailureMechanism); if (hydraulicBoundaryLocationAffected.Any()) { log.Info(Resources.FailureMechanismContributionNormChangeHandler_Waveheight_and_design_water_level_results_cleared); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs =================================================================== diff -u -r2ff2a985fe9015df6da49fe43006e5c7631434c3 -r0a5a1c7fad7e52c152e3ff34eebcccf7785b377d --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs (.../FailureMechanismContributionNormChangeHandlerTest.cs) (revision 2ff2a985fe9015df6da49fe43006e5c7631434c3) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs (.../FailureMechanismContributionNormChangeHandlerTest.cs) (revision 0a5a1c7fad7e52c152e3ff34eebcccf7785b377d) @@ -141,7 +141,7 @@ TestDelegate call = () => handler.ChangeNorm(assessmentSection, invalidNorm); // Assert - const string expectedMessage = "De faalkansbijdrage kan alleen bepaald worden als de norm van het traject groter is dan 0."; + const string expectedMessage = "Kans moet in het bereik [0, 1] liggen."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); } @@ -205,7 +205,7 @@ // Precondition CollectionAssert.IsEmpty(section.GetFailureMechanisms().SelectMany(fm => fm.Calculations).Where(c => c.HasOutput)); - + var handler = new FailureMechanismContributionNormChangeHandler(); IEnumerable affectedObjects = null;