Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilProfileTransformerTest.cs =================================================================== diff -u -rc71efcd328d420bd869028dd35d035ff02d98ec2 -r25a8f2ee9f77aa01d7c9209b27075bafb9469aff --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilProfileTransformerTest.cs (.../PipingSoilProfileTransformerTest.cs) (revision c71efcd328d420bd869028dd35d035ff02d98ec2) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilProfileTransformerTest.cs (.../PipingSoilProfileTransformerTest.cs) (revision 25a8f2ee9f77aa01d7c9209b27075bafb9469aff) @@ -183,7 +183,7 @@ { // Setup var random = new Random(21); - var profile = new SoilProfile2D(0, string.Empty, Enumerable.Empty(), Enumerable.Empty()) + var profile = new SoilProfile2D(0, "A profile name", Enumerable.Empty(), Enumerable.Empty()) { IntersectionX = random.NextDouble() }; @@ -196,7 +196,8 @@ Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); - Assert.AreEqual(innerException.Message, exception.Message); + string expectedMessage = CreateExpectedErrorMessage(profile.Name, innerException.Message); + Assert.AreEqual(expectedMessage, exception.Message); } [Test] @@ -394,7 +395,8 @@ Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); - Assert.AreEqual(innerException.Message, exception.Message); + string expectedMessage = CreateExpectedErrorMessage(profileName, innerException.Message); + Assert.AreEqual(expectedMessage, exception.Message); } [Test] @@ -459,6 +461,12 @@ Assert.AreEqual(bottom, transformed.Bottom); } + private static string CreateExpectedErrorMessage(string soilProfileName, string errorMessage) + { + return $"Er is een fout opgetreden bij het inlezen van ondergrondschematisatie '{soilProfileName}': " + + $"{errorMessage}"; + } + private static void AssertPipingSoilLayers(IEnumerable expectedSoilLayer2Ds, IEnumerable actualSoilLayer2Ds) {