Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs =================================================================== diff -u -re71f7a8977226f7bdbc146c4e5aac1f13c39e3eb -r5a421e7bb0b0c52d5d1d9ca20d495cd11bfa10e8 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs (.../DikeProfileLocationReaderTest.cs) (revision e71f7a8977226f7bdbc146c4e5aac1f13c39e3eb) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileLocationReaderTest.cs (.../DikeProfileLocationReaderTest.cs) (revision 5a421e7bb0b0c52d5d1d9ca20d495cd11bfa10e8) @@ -164,29 +164,44 @@ } [Test] - [TestCase("Voorlanden_12-2_EmptyId.shp", "ID")] - [TestCase("Voorlanden_12-2_EmptyX0.shp", "X0")] - public void GetDikeProfileLocations_FileWithEmptyEntryInColumn_ThrowCriticalFileReadException( - string fileName, string offendingColumnName) + public void GetDikeProfileLocations_FileWithNullId_ThrowCriticalFileReadException() { // Setup string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", fileName)); + Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyId.shp")); using (var reader = new DikeProfileLocationReader(invalidFilePath)) { // Call TestDelegate call = () => reader.GetDikeProfileLocations(); // Assert - var expectedMessage = string.Format("Het bestand heeft een attribuut '{0}' zonder geldige waarde, welke vereist is om de locaties van de dijkprofielen in te lezen.", - offendingColumnName); + var expectedMessage = "De locatie parameter 'Id' heeft geen waarde."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } } [Test] + public void GetDikeProfileLocations_FileWithNullX0_ThrowCriticalFileReadException() + { + // Setup + string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, + Path.Combine("DikeProfiles", "Voorlanden_12-2_EmptyX0.shp")); + + using (var reader = new DikeProfileLocationReader(invalidFilePath)) + { + // Call + TestDelegate call = () => reader.GetDikeProfileLocations(); + + // Assert + var expectedMessage = "Het bestand heeft een attribuut 'X0' zonder geldige waarde, welke vereist is om de locaties van de dijkprofielen in te lezen."; + string message = Assert.Throws(call).Message; + Assert.AreEqual(expectedMessage, message); + } + } + + [Test] [TestCase("Voorlanden_12-2_IdWithSymbol.shp")] [TestCase("Voorlanden_12-2_IdWithWhitespace.shp")] public void GetDikeProfileLocations_FileWithIllegalCharactersInId_ThrowCriticalFileReadException(string fileName) @@ -201,7 +216,7 @@ TestDelegate call = () => reader.GetDikeProfileLocations(); // Assert - var expectedMessage = "Het bestand bevat het attribuut Id met een waarde welke uit meer dan alleen letters en cijfers bestaat."; + var expectedMessage = "De locatie parameter 'Id' bevat meer dan letters en cijfers."; string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); }