Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelTransformerTest.cs =================================================================== diff -u -r57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff -rc5c91f8ca724aef52a6cd9055a2a32bcd6bc0c03 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelTransformerTest.cs (.../MacroStabilityInwardsStochasticSoilModelTransformerTest.cs) (revision 57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelTransformerTest.cs (.../MacroStabilityInwardsStochasticSoilModelTransformerTest.cs) (revision c5c91f8ca724aef52a6cd9055a2a32bcd6bc0c03) @@ -271,15 +271,12 @@ [Test] [SetCulture("nl-NL")] - public void Transform_ValidStochasticSoilModelWithSameProfileProbabilitExceedingValidRange_ThrowsImportedDataException() + [TestCaseSource(nameof(GetValidConfiguredAndSupportedSoilProfiles))] + public void Transform_ValidStochasticSoilModelWithSameProfileProbabilityExceedingValidRange_ThrowsImportedDataException(ISoilProfile profile) { // Setup const string soilModelName = "name"; - var mocks = new MockRepository(); - var profile = mocks.Stub(); - mocks.ReplayAll(); - StochasticSoilModel soilModel = StochasticSoilModelTestFactory.CreateStochasticSoilModelWithGeometry(soilModelName, FailureMechanismType.Stability, new[] { @@ -296,9 +293,7 @@ var exception = Assert.Throws(call); const string expectedMessage = "Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel " + "moet in het bereik [0,0, 1,0] liggen."; - Assert.AreEqual(expectedMessage, exception.Message); - - mocks.VerifyAll(); + StringAssert.StartsWith(expectedMessage, exception.Message); } [Test] @@ -356,5 +351,23 @@ .Cast() .Where(t => t != FailureMechanismType.Stability); } + + private static IEnumerable GetValidConfiguredAndSupportedSoilProfiles() + { + var random = new Random(21); + + const long id = 1; + const string name = "test"; + + yield return new SoilProfile2D(id, name, new[] + { + SoilLayer2DTestFactory.CreateSoilLayer2DWithValidAquifer() + }, Enumerable.Empty()); + + yield return new SoilProfile1D(id, name, random.NextDouble(), new [] + { + SoilLayer1DTestFactory.CreateSoilLayer1DWithValidAquifer() + }); + } } } \ No newline at end of file