Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Ringtoets.MacroStabilityInwards.IO.csproj
===================================================================
diff -u -r5add1ecd1be36fd829a95fc68d32bd4b0ec70525 -r053147673eaa4012f8a4e1b3759a7bb5cd0c4634
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Ringtoets.MacroStabilityInwards.IO.csproj (.../Ringtoets.MacroStabilityInwards.IO.csproj) (revision 5add1ecd1be36fd829a95fc68d32bd4b0ec70525)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Ringtoets.MacroStabilityInwards.IO.csproj (.../Ringtoets.MacroStabilityInwards.IO.csproj) (revision 053147673eaa4012f8a4e1b3759a7bb5cd0c4634)
@@ -52,7 +52,7 @@
-
+
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilModelFilter.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilModelFilter.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilModelFilter.cs (revision 053147673eaa4012f8a4e1b3759a7bb5cd0c4634)
@@ -0,0 +1,43 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Ringtoets.Common.IO.SoilProfile;
+using Ringtoets.Common.IO.SoilProfile.Schema;
+
+namespace Ringtoets.MacroStabilityInwards.IO.SoilProfiles
+{
+ ///
+ /// Class to that can be used to filter stochastic soil models for the macro stability inwards failure mechanism.
+ ///
+ public class MacroStabilityInwardsStochasticSoilModelFilter : IStochasticSoilModelMechanismFilter
+ {
+ public bool IsValidForFailureMechanism(StochasticSoilModel stochasticSoilModel)
+ {
+ if (stochasticSoilModel == null)
+ {
+ throw new ArgumentNullException(nameof(stochasticSoilModel));
+ }
+
+ return stochasticSoilModel.FailureMechanismType == FailureMechanismType.Stability;
+ }
+ }
+}
Fisheye: Tag 053147673eaa4012f8a4e1b3759a7bb5cd0c4634 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/SoilProfiles/MacroStabilityInwardsStochasticSoilModelMechanismFilter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Ringtoets.MacroStabilityInwards.IO.Test.csproj
===================================================================
diff -u -r5add1ecd1be36fd829a95fc68d32bd4b0ec70525 -r053147673eaa4012f8a4e1b3759a7bb5cd0c4634
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Ringtoets.MacroStabilityInwards.IO.Test.csproj (.../Ringtoets.MacroStabilityInwards.IO.Test.csproj) (revision 5add1ecd1be36fd829a95fc68d32bd4b0ec70525)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/Ringtoets.MacroStabilityInwards.IO.Test.csproj (.../Ringtoets.MacroStabilityInwards.IO.Test.csproj) (revision 053147673eaa4012f8a4e1b3759a7bb5cd0c4634)
@@ -80,7 +80,7 @@
-
+
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelFilterTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelFilterTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelFilterTest.cs (revision 053147673eaa4012f8a4e1b3759a7bb5cd0c4634)
@@ -0,0 +1,88 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NUnit.Framework;
+using Ringtoets.Common.IO.SoilProfile;
+using Ringtoets.Common.IO.SoilProfile.Schema;
+using Ringtoets.MacroStabilityInwards.IO.SoilProfiles;
+
+namespace Ringtoets.MacroStabilityInwards.IO.Test.SoilProfiles
+{
+ [TestFixture]
+ public class MacroStabilityInwardsStochasticSoilModelFilterTest
+ {
+ [Test]
+ public void Constructor_StochasticSoilModelNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var filter = new MacroStabilityInwardsStochasticSoilModelFilter();
+
+ // Call
+ TestDelegate test = () => filter.IsValidForFailureMechanism(null);
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("stochasticSoilModel", exception.ParamName);
+ }
+
+ [Test]
+ [TestCaseSource(nameof(StochasticSoilModelsOfInvalidType))]
+ public void Constructor_StochasticSoilModelOfInvalidType_ReturnsFalse(StochasticSoilModel model)
+ {
+ // Setup
+ var filter = new MacroStabilityInwardsStochasticSoilModelFilter();
+
+ // Call
+ bool isValid = filter.IsValidForFailureMechanism(model);
+
+ // Assert
+ Assert.IsFalse(isValid);
+ }
+
+ [Test]
+ public void Constructor_ValidStochasticSoilModelType_ReturnsFalse()
+ {
+ // Setup
+ var filter = new MacroStabilityInwardsStochasticSoilModelFilter();
+ var model = new StochasticSoilModel(nameof(FailureMechanismType.Stability), FailureMechanismType.Stability);
+
+ // Call
+ bool isValid = filter.IsValidForFailureMechanism(model);
+
+ // Assert
+ Assert.IsTrue(isValid);
+ }
+
+ private static IEnumerable StochasticSoilModelsOfInvalidType()
+ {
+ return Enum.GetValues(typeof(FailureMechanismType))
+ .Cast()
+ .Where(type => type != FailureMechanismType.Stability)
+ .Select(type => new TestCaseData(
+ new StochasticSoilModel(type.ToString(), type))
+ .SetName($"Constructor_InvalidType_ReturnsFalse({type.ToString()})")
+ );
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 053147673eaa4012f8a4e1b3759a7bb5cd0c4634 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelMechanismFilterTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?