Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilProfileTransformerTest.cs =================================================================== diff -u -r9f9b40be8a207b1d4ff944bee747f472a64077a7 -r38940fd430501da3c19ac8c90f660b21f8938909 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilProfileTransformerTest.cs (.../MacroStabilityInwardsSoilProfileTransformerTest.cs) (revision 9f9b40be8a207b1d4ff944bee747f472a64077a7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsSoilProfileTransformerTest.cs (.../MacroStabilityInwardsSoilProfileTransformerTest.cs) (revision 38940fd430501da3c19ac8c90f660b21f8938909) @@ -82,8 +82,7 @@ Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); - string expectedMessage = CreateExpectedErrorMessage(profile.Name, innerException.Message); - Assert.AreEqual(expectedMessage, exception.Message); + Assert.AreEqual(innerException.Message, exception.Message); } [Test] @@ -118,8 +117,8 @@ var exception = Assert.Throws(call); Exception innerException = exception.InnerException; - string expectedMessage = CreateExpectedErrorMessage(profile.Name, innerException.Message); - Assert.AreEqual(expectedMessage, exception.Message); + Assert.IsInstanceOf(innerException); + Assert.AreEqual(innerException.Message, exception.Message); } [Test] @@ -150,7 +149,7 @@ { XCoordinate = random.NextDouble(), ZCoordinate = random.NextDouble(), - StressDistributionType = SoilLayerConstants.LogNormalDistributionValue, + StressDistributionType = 3, StressMean = random.NextDouble(), StressCoefficientOfVariation = random.NextDouble(), StressShift = 0 @@ -171,46 +170,6 @@ AssertPreconsolidationStress(preconsolidationStress, transformedProfile.PreconsolidationStresses.Single()); } - [Test] - public void Transform_SoilProfile2DWithInvalidPreconsolidationStress_ThrowsImportedDataException() - { - var random = new Random(21); - var preconsolidationStress = new PreconsolidationStress - { - XCoordinate = double.NaN, - ZCoordinate = random.NextDouble(), - StressDistributionType = SoilLayerConstants.LogNormalDistributionValue, - StressMean = random.NextDouble(), - StressCoefficientOfVariation = random.NextDouble(), - StressShift = 0 - }; - - var profile = new SoilProfile2D(1, "test", new[] - { - SoilLayer2DTestFactory.CreateSoilLayer2D() - }, new[] - { - preconsolidationStress - }); - - // Call - TestDelegate call = () => MacroStabilityInwardsSoilProfileTransformer.Transform(profile); - - // Assert - var exception = Assert.Throws(call); - - Exception innerException = exception.InnerException; - Assert.IsInstanceOf(innerException); - string expectedMessage = CreateExpectedErrorMessage(profile.Name, innerException.Message); - Assert.AreEqual(expectedMessage, exception.Message); - } - - private static string CreateExpectedErrorMessage(string soilProfileName, string errorMessage) - { - return $"Er is een fout opgetreden bij het inlezen van ondergrondschematisatie '{soilProfileName}': " + - $"{errorMessage}"; - } - private static void AssertPreconsolidationStress(PreconsolidationStress preconsolidationStress, MacroStabilityInwardsPreconsolidationStress transformedPreconsolidationStress) {