Index: Core/Common/src/Core.Common.Utils/Properties/Resources.Designer.cs =================================================================== diff -u -rf72f906a6875250a4378945ce814997ff8aaf1a7 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Core/Common/src/Core.Common.Utils/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) +++ Core/Common/src/Core.Common.Utils/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -151,6 +151,15 @@ } /// + /// Looks up a localized string similar to op regel {0}. + /// + public static string TextFile_On_LineNumber_0_ { + get { + return ResourceManager.GetString("TextFile_On_LineNumber_0_", resourceCulture); + } + } + + /// /// Looks up a localized string similar to '{0}' is geen geldige expressie voor deze methode.. /// public static string TypeUtils_GetMemberName_0_is_not_a_valid_expression_for_this_method { Index: Core/Common/src/Core.Common.Utils/Properties/Resources.resx =================================================================== diff -u -rf72f906a6875250a4378945ce814997ff8aaf1a7 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Core/Common/src/Core.Common.Utils/Properties/Resources.resx (.../Resources.resx) (revision f72f906a6875250a4378945ce814997ff8aaf1a7) +++ Core/Common/src/Core.Common.Utils/Properties/Resources.resx (.../Resources.resx) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -150,4 +150,7 @@ Er is een onverwachte fout opgetreden tijdens het inlezen van het bestand. + + op regel {0} + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileDataReader.cs =================================================================== diff -u -r9102a2e0e7257b746bbc884be57d5b8dce3dab57 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileDataReader.cs (.../DikeProfileDataReader.cs) (revision 9102a2e0e7257b746bbc884be57d5b8dce3dab57) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/DikeProfiles/DikeProfileDataReader.cs (.../DikeProfileDataReader.cs) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -19,22 +19,48 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Globalization; using System.IO; +using System.Linq; using System.Text.RegularExpressions; using Core.Common.Base.Geometry; +using Core.Common.IO.Exceptions; +using Core.Common.Utils; +using Core.Common.Utils.Builders; using Ringtoets.GrassCoverErosionInwards.Data; +using CoreCommonUtilsResources = Core.Common.Utils.Properties.Resources; +using UtilsResources = Core.Common.Utils.Properties.Resources; + namespace Ringtoets.GrassCoverErosionInwards.IO.DikeProfiles { /// /// Reader responsible for reading the data for a dike profile from a .prfl file. /// public class DikeProfileDataReader { + [Flags] + private enum ParametersFoundInFile + { + None = 0, + VERSIE = 1, + ID = 2, + RICHTING = 4, + DAM = 8, + DAMHOOGTE = 16, + VOORLAND = 32, + DAMWAND = 64, + KRUINHOOGTE = 128, + DIJK = 256, + MEMO = 512, + All = 1023 + } + private const string idPattern = @"^ID\s+(?\w+)$"; + private const string versionPattern = @"^VERSIE\s+(?\S+)$"; private const string orientationPattern = @"^RICHTING\s+(?\d+(?:\.\d+)?)$"; private const string damTypePattern = @"^DAM\s+(?\d)$"; private const string profileTypePattern = @"^DAMWAND\s+(?\d)$"; @@ -45,34 +71,54 @@ private const string roughnessSectionPattern = @"^(?-?\d+(?:\.\d+)?)\s+(?-?\d+(?:\.\d+)?)\s+(?-?\d+(?:\.\d+)?)$"; private const string memoPattern = @"^MEMO$"; + private string fileBeingRead; + /// /// Reads the *.prfl file for dike profile data. /// /// The file path. /// The read dike profile data. public DikeProfileData ReadDikeProfileData(string filePath) { + FileUtils.ValidateFilePath(filePath); + if (!File.Exists(filePath)) + { + string message = new FileReaderErrorMessageBuilder(filePath) + .Build(CoreCommonUtilsResources.Error_File_does_not_exist); + throw new CriticalFileReadException(message); + } + + // TODO: Duplicate entries var data = new DikeProfileData(); + ParametersFoundInFile readParameters = ParametersFoundInFile.None; using (var reader = new StreamReader(filePath)) { + fileBeingRead = filePath; string text; - while ((text = reader.ReadLine()) != null) + int lineNumber = 0; + while ((text = ReadLineAndHandleIOExceptions(reader, 1)) != null) { + lineNumber++; if (string.IsNullOrWhiteSpace(text)) { continue; } - // TODO: Read Version - // TODO: Validate version - // TODO: Ensure Version in file + Match versionMatch = new Regex(versionPattern).Match(text); + if (versionMatch.Success) + { + //versionMatch.Groups["version"].Value; + // TODO: Validate version (needs to be 4.0) + readParameters |= ParametersFoundInFile.VERSIE; + continue; + } Match idMatch = new Regex(idPattern).Match(text); if (idMatch.Success) { data.Id = idMatch.Groups["id"].Value; // TODO: Validate id (needs different regex) - // TODO: Ensure ID in file + readParameters |= ParametersFoundInFile.ID; continue; } Match orientationMatch = new Regex(orientationPattern).Match(text); @@ -81,7 +127,7 @@ data.Orientation = double.Parse(orientationMatch.Groups["orientation"].Value, CultureInfo.InvariantCulture); // TODO: Validate orientation [0, 360] range // TODO: Validate can be parsed - // TODO: Ensure orientation in file + readParameters |= ParametersFoundInFile.RICHTING; continue; } Match damTypeMatch = new Regex(damTypePattern).Match(text); @@ -90,7 +136,7 @@ data.DamType = (DamType)int.Parse(damTypeMatch.Groups["damtype"].Value, CultureInfo.InvariantCulture); // TODO: Validate damtype [0, 3] range // TODO: Validate can be parsed - // TODO: Ensure in file + readParameters |= ParametersFoundInFile.DAM; continue; } Match profileTypeMatch = new Regex(profileTypePattern).Match(text); @@ -99,23 +145,23 @@ data.ProfileType = (ProfileType)int.Parse(profileTypeMatch.Groups["profiletype"].Value, CultureInfo.InvariantCulture); // TODO: Validate profile type [0, 2] range // TODO: Validate can be parsed - // TODO: Ensure in file + readParameters |= ParametersFoundInFile.DAMWAND; continue; } Match damHeightMatch = new Regex(damHeightPattern).Match(text); if (damHeightMatch.Success) { data.DamHeight = double.Parse(damHeightMatch.Groups["damheight"].Value, CultureInfo.InvariantCulture); // TODO: Validate can be parsed - // TODO: Ensure in file + readParameters |= ParametersFoundInFile.DAMHOOGTE; continue; } Match crestLevelMatch = new Regex(crestLevelPattern).Match(text); if (crestLevelMatch.Success) { data.CrestLevel = double.Parse(crestLevelMatch.Groups["crestlevel"].Value, CultureInfo.InvariantCulture); // TODO: Validate can be parsed - // TODO: Ensure in file + readParameters |= ParametersFoundInFile.KRUINHOOGTE; continue; } Match dikeGeometryMatch = new Regex(dikeGeometryPattern).Match(text); @@ -124,12 +170,12 @@ int numberOfElements = int.Parse(dikeGeometryMatch.Groups["dikegeometry"].Value, CultureInfo.InvariantCulture); // TODO: Validate dikegeometry count > 0 // TODO: Validate can be parsed - // TODO: Ensure in file if (numberOfElements == 0) { + readParameters |= ParametersFoundInFile.DIJK; continue; } - data.DikeGeometry = new RoughnessProfileSection[numberOfElements-1]; + data.DikeGeometry = new RoughnessProfileSection[numberOfElements - 1]; double previousLocalX = 0, previousLocalZ = 0, previousRoughness = 0; for (int i = 0; i < numberOfElements; i++) @@ -150,6 +196,7 @@ previousLocalZ = localZ; previousRoughness = roughness; } + readParameters |= ParametersFoundInFile.DIJK; continue; } Match foreshoreGeometryMatch = new Regex(foreshoreGeometryPattern).Match(text); @@ -158,12 +205,12 @@ int numberOfElements = int.Parse(foreshoreGeometryMatch.Groups["foreshoregeometry"].Value, CultureInfo.InvariantCulture); // TODO: Validate foreshore geometry count > 0 // TODO: Validate can be parsed - // TODO: Ensure in file if (numberOfElements == 0) { + readParameters |= ParametersFoundInFile.VOORLAND; continue; } - data.ForeshoreGeometry = new RoughnessProfileSection[numberOfElements-1]; + data.ForeshoreGeometry = new RoughnessProfileSection[numberOfElements - 1]; double previousLocalX = 0, previousLocalZ = 0, previousRoughness = 0; for (int i = 0; i < numberOfElements; i++) { @@ -183,17 +230,80 @@ previousLocalZ = localZ; previousRoughness = roughness; } + readParameters |= ParametersFoundInFile.VOORLAND; continue; } Match memoMatch = new Regex(memoPattern).Match(text); if (memoMatch.Success) { - // TODO: Ensure in file data.Memo = reader.ReadToEnd(); + readParameters |= ParametersFoundInFile.MEMO; + continue; } } } + var requiredParameters = new[] + { + ParametersFoundInFile.VERSIE, + ParametersFoundInFile.ID, + ParametersFoundInFile.RICHTING, + ParametersFoundInFile.DAM, + ParametersFoundInFile.DAMHOOGTE, + ParametersFoundInFile.VOORLAND, + ParametersFoundInFile.DAMWAND, + ParametersFoundInFile.KRUINHOOGTE, + ParametersFoundInFile.DIJK, + ParametersFoundInFile.MEMO + }; + string[] missingParameters = requiredParameters.Where(z => !readParameters.HasFlag(z)).Select(z => z.ToString()).ToArray(); + if (missingParameters.Any()) + { + string criticalErrorMessage = string.Format("De volgende parameter(s) zijn niet aanwezig in het bestand: {0}", + String.Join(", ", missingParameters)); + var message = new FileReaderErrorMessageBuilder(fileBeingRead) + .Build(criticalErrorMessage); + throw new CriticalFileReadException(message); + } return data; } + + /// + /// Reads the next line and handles I/O exceptions. + /// + /// The opened text file reader. + /// Row number for error messaging. + /// The read line, or null when at the end of the file. + /// An critical I/O exception occurred. + private string ReadLineAndHandleIOExceptions(TextReader reader, int currentLine) + { + try + { + return reader.ReadLine(); + } + catch (OutOfMemoryException e) + { + throw CreateCriticalFileReadException(currentLine, UtilsResources.Error_Line_too_big_for_RAM, e); + } + catch (IOException e) + { + var message = new FileReaderErrorMessageBuilder(fileBeingRead).Build(string.Format(UtilsResources.Error_General_IO_ErrorMessage_0_, e.Message)); + throw new CriticalFileReadException(message, e); + } + } + + /// + /// Throws a configured instance of . + /// + /// The line number being read. + /// The critical error message. + /// Optional: exception that caused this exception to be thrown. + /// New with message and inner exception set. + private CriticalFileReadException CreateCriticalFileReadException(int currentLine, string criticalErrorMessage, Exception innerException = null) + { + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); + var message = new FileReaderErrorMessageBuilder(fileBeingRead).WithLocation(locationDescription) + .Build(criticalErrorMessage); + return new CriticalFileReadException(message, innerException); + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Ringtoets.GrassCoverErosionInwards.IO.csproj =================================================================== diff -u -r9102a2e0e7257b746bbc884be57d5b8dce3dab57 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Ringtoets.GrassCoverErosionInwards.IO.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.csproj) (revision 9102a2e0e7257b746bbc884be57d5b8dce3dab57) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/Ringtoets.GrassCoverErosionInwards.IO.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.csproj) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -55,6 +55,14 @@ {3bbfd65b-b277-4e50-ae6d-bd24c3434609} Core.Common.Base + + {e344867e-9ac9-44c8-88a5-8185681679a9} + Core.Common.IO + + + {f49bd8b2-332a-4c91-a196-8cce0a2c7d98} + Core.Common.Utils + {c90b77da-e421-43cc-b82e-529651bc21ac} Core.Common.Version Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs =================================================================== diff -u -r9102a2e0e7257b746bbc884be57d5b8dce3dab57 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision 9102a2e0e7257b746bbc884be57d5b8dce3dab57) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/DikeProfiles/DikeProfileDataReaderTest.cs (.../DikeProfileDataReaderTest.cs) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -23,6 +23,7 @@ using System.IO; using Core.Common.Base.Geometry; +using Core.Common.IO.Exceptions; using Core.Common.TestUtil; using NUnit.Framework; @@ -35,11 +36,87 @@ public class DikeProfileDataReaderTest { [Test] + [TestCase("")] + [TestCase(" ")] + [TestCase(null)] + public void ReadDikeProfileData_NoFilePath_ThrowArgumentException(string invalidFilePath) + { + // Setup + var reader = new DikeProfileDataReader(); + + // Call + TestDelegate call = () => reader.ReadDikeProfileData(invalidFilePath); + + // Assert + var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': Bestandspad mag niet leeg of ongedefinieerd zijn.", + invalidFilePath); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] + public void ReadReferenceLine_FilePathHasInvalidPathCharacter_ThrowArgumentException() + { + // Setup + char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); + + string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, + Path.Combine("DikeProfiles", "profiel001 - Ringtoets.prfl")); + string invalidFilePath = validFilePath.Replace("-", invalidFileNameChars[3].ToString()); + + var reader = new DikeProfileDataReader(); + + // Call + TestDelegate call = () => reader.ReadDikeProfileData(invalidFilePath); + + // Assert + var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': Bestandspad mag niet de volgende tekens bevatten: {1}", + invalidFilePath, String.Join(", ", invalidFileNameChars)); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] + public void ReadReferenceLine_FilePathIsActuallyDirectoryPath_ThrowArgumentException() + { + // Setup + string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, + Path.DirectorySeparatorChar.ToString()); + + var reader = new DikeProfileDataReader(); + + // Call + TestDelegate call = () => reader.ReadDikeProfileData(invalidFilePath); + + // Assert + var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': Bestandspad mag niet naar een map verwijzen.", + invalidFilePath); + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] + public void ReadReferenceLine_ShapefileDoesntExist_ThrowCriticalFileReadException() + { + // Setup + string invalidFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, + "I_do_not_exist.shp"); + + var reader = new DikeProfileDataReader(); + + // Call + TestDelegate call = () => reader.ReadDikeProfileData(invalidFilePath); + + // Assert + var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': Het bestand bestaat niet.", + invalidFilePath); + var message = Assert.Throws(call).Message; + Assert.AreEqual(expectedMessage, message); + } + + [Test] public void ReadDikeProfileData_ValidFilePath1_ReturnDikeProfileData() { // Setup string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, - Path.Combine("DikeProfiles", "profiel001 - Ringtoets.prfl")); + Path.Combine("DikeProfiles", "profiel001 - Ringtoets.prfl")); var reader = new DikeProfileDataReader(); @@ -111,5 +188,37 @@ "talud met (ruwe) berm" + Environment.NewLine; Assert.AreEqual(expectedMemo, result.Memo); } + + [Test] + [TestCase("faulry_noId.prfl", "ID")] + [TestCase("faulty_emptyFile.prfl", "VERSIE, ID, RICHTING, DAM, DAMHOOGTE, VOORLAND, DAMWAND, KRUINHOOGTE, DIJK, MEMO")] + [TestCase("faulty_noDam.prfl", "DAM")] + [TestCase("faulty_noDamHoogte.prfl", "DAMHOOGTE")] + [TestCase("faulty_noDamWand.prfl", "DAMWAND")] + [TestCase("faulty_noDijk.prfl", "DIJK")] + [TestCase("faulty_noKruinHoogte.prfl", "KRUINHOOGTE")] + [TestCase("faulty_NoMemo.prfl", "MEMO")] + [TestCase("faulty_noRichting.prfl", "RICHTING")] + [TestCase("faulty_noVersie.prfl", "VERSIE")] + [TestCase("faulty_noVoorland.prfl", "VOORLAND")] + public void ReadDikeProfileData_FaultyFilesWithMissingParameters_ThrowCriticalFileReadException( + string faultyFileName, string missingParameterNames) + { + // Setup + string faultyFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.GrassCoverErosionInwards.IO, + Path.Combine("DikeProfiles", faultyFileName)); + + var reader = new DikeProfileDataReader(); + + // Call + TestDelegate call = () => reader.ReadDikeProfileData(faultyFilePath); + + // Assert + string message = Assert.Throws(call).Message; + string expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': De volgende parameter(s) zijn niet aanwezig in het bestand: {1}", + faultyFilePath, missingParameterNames); + Assert.AreEqual(expectedMessage, message); + } + // TODO: DAMWAND en DAMWAND Type coverage (beide files hebben dezelfde waardes) } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Ringtoets.GrassCoverErosionInwards.IO.Test.csproj =================================================================== diff -u -r9102a2e0e7257b746bbc884be57d5b8dce3dab57 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Ringtoets.GrassCoverErosionInwards.IO.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.Test.csproj) (revision 9102a2e0e7257b746bbc884be57d5b8dce3dab57) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Ringtoets.GrassCoverErosionInwards.IO.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.IO.Test.csproj) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -60,6 +60,10 @@ {3bbfd65b-b277-4e50-ae6d-bd24c3434609} Core.Common.Base + + {e344867e-9ac9-44c8-88a5-8185681679a9} + Core.Common.IO + {d749ee4c-ce50-4c17-bf01-9a953028c126} Core.Common.TestUtil Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulry_noId.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulry_noId.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulry_noId.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,21 @@ +VERSIE 4.0 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_NoMemo.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_NoMemo.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_NoMemo.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + + +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_emptyFile.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_emptyFile.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_emptyFile.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,2 @@ + + Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDam.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDam.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDam.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + + +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDamHoogte.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDamHoogte.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDamHoogte.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + +DAM 0 + + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDamWand.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDamWand.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDamWand.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + + +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDijk.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDijk.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noDijk.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 + +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noKruinHoogte.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noKruinHoogte.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noKruinHoogte.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 + +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noRichting.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noRichting.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noRichting.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + + + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noVersie.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noVersie.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noVersie.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,21 @@ +ID profiel001 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + +VOORLAND 0 + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noVoorland.prfl =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noVoorland.prfl (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/test-data/DikeProfiles/faulty_noVoorland.prfl (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -0,0 +1,22 @@ +VERSIE 4.0 +ID profiel001 + +RICHTING 330 + +DAM 0 +DAMHOOGTE 0 + + + +DAMWAND 0 +KRUINHOOGTE 6 +DIJK 2 +0.000 0.000 1.000 +18.000 6.000 1.000 + +MEMO +Verkenning prfl format: +Basis: +geen dam +geen voorland +recht talud Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs =================================================================== diff -u -r0031cba0c908082339034ed247c47b609e563a77 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0031cba0c908082339034ed247c47b609e563a77) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -351,14 +351,5 @@ return ResourceManager.GetString("StochasticSoilProfileDatabaseReader_StochasticSoilProfile_has_invalid_value", resourceCulture); } } - - /// - /// Looks up a localized string similar to op regel {0}. - /// - public static string TextFile_On_LineNumber_0_ { - get { - return ResourceManager.GetString("TextFile_On_LineNumber_0_", resourceCulture); - } - } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx =================================================================== diff -u -r0031cba0c908082339034ed247c47b609e563a77 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx (.../Resources.resx) (revision 0031cba0c908082339034ed247c47b609e563a77) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx (.../Resources.resx) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -171,9 +171,6 @@ Coördinaat van een punt bevat ongeldige waarde. - - op regel {0} - profielschematisatie '{0}' Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/CharacteristicPointsCsvReader.cs =================================================================== diff -u -r64d5609bb2912cd52dc74deffdd189222e240599 -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision 64d5609bb2912cd52dc74deffdd189222e240599) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -488,7 +488,7 @@ /// New with message and inner exception set. private CriticalFileReadException CreateCriticalFileReadException(int currentLine, string criticalErrorMessage, Exception innerException = null) { - string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine); + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription) .Build(criticalErrorMessage); return new CriticalFileReadException(message, innerException); @@ -502,7 +502,7 @@ /// New with message set. private LineParseException CreateLineParseException(int currentLine, string lineParseErrorMessage) { - string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine); + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription) .Build(lineParseErrorMessage); return new LineParseException(message); @@ -518,7 +518,7 @@ /// New with message and inner exceptions set. private LineParseException CreateLineParseException(int currentLine, string locationName, string lineParseErrorMessage, Exception innerException = null) { - string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine); + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); string subjectDescription = string.Format(Resources.CharacteristicPointsCsvReader_LocationName_0_, locationName); var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription) .WithSubject(subjectDescription) Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/PipingSurfaceLinesCsvReader.cs =================================================================== diff -u -rd82fa09fe9ae053ce7702ba89ef23ae029640d1b -rbbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0 --- Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/PipingSurfaceLinesCsvReader.cs (.../PipingSurfaceLinesCsvReader.cs) (revision d82fa09fe9ae053ce7702ba89ef23ae029640d1b) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/PipingSurfaceLinesCsvReader.cs (.../PipingSurfaceLinesCsvReader.cs) (revision bbf8e2a3fb6e709c7d7a5ddbd955575f83720cc0) @@ -376,7 +376,7 @@ /// New with message and inner exception set. private CriticalFileReadException CreateCriticalFileReadException(int currentLine, string criticalErrorMessage, Exception innerException = null) { - string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine); + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription) .Build(criticalErrorMessage); return new CriticalFileReadException(message, innerException); @@ -390,7 +390,7 @@ /// New with message set. private LineParseException CreateLineParseException(int currentLine, string lineParseErrorMessage) { - string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine); + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription) .Build(lineParseErrorMessage); return new LineParseException(message); @@ -406,7 +406,7 @@ /// New with message and inner exceptions set. private LineParseException CreateLineParseException(int currentLine, string surfaceLineName, string lineParseErrorMessage, Exception innerException = null) { - string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine); + string locationDescription = string.Format(UtilsResources.TextFile_On_LineNumber_0_, currentLine); string subjectDescription = string.Format(Resources.PipingSurfaceLinesCsvReader_SurfaceLineName_0_, surfaceLineName); var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription) .WithSubject(subjectDescription)