Index: Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs =================================================================== diff -u -r357925a9ba2aebce58a9e03e620c6d470323672f -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs (.../StorageSqLite.cs) (revision 357925a9ba2aebce58a9e03e620c6d470323672f) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/StorageSqLite.cs (.../StorageSqLite.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -320,7 +320,7 @@ } /// - /// Throws a configured instance of when writing to the storage file failed. + /// Creates a configured instance of when writing to the storage file failed. /// /// The path of the file that was attempted to connect with. /// The critical error message. @@ -333,7 +333,7 @@ } /// - /// Throws a configured instance of when reading the storage file failed. + /// Creates a configured instance of when reading the storage file failed. /// /// The path of the file that was attempted to connect with. /// The critical error message. Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -529,7 +529,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The critical error message. @@ -545,7 +545,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The critical error message. Index: Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/CharacteristicPointsCsvReader.cs =================================================================== diff -u -r5579d8fdef4f553fb4ba94160825ec960b89bab9 -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision 5579d8fdef4f553fb4ba94160825ec960b89bab9) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -37,7 +37,7 @@ { /// /// File reader for a plain text file in comma-separated values format (*.csv), containing - /// data specifying characteristic points. + /// data specifying characteristic points. /// Expects data to be specified in the following format: /// /// LocationID;X_Maaiveld binnenwaarts;Y_Maaiveld binnenwaarts;Z_Maaiveld binnenwaarts;X_Insteek sloot polderzijde;Y_Insteek sloot polderzijde;Z_Insteek sloot polderzijde;X_Slootbodem polderzijde;Y_Slootbodem polderzijde;Z_Slootbodem polderzijde;X_Slootbodem dijkzijde;Y_Slootbodem dijkzijde;Z_Slootbodem dijkzijde;X_Insteek sloot dijkzijde;Y_Insteek_sloot dijkzijde;Z_Insteek sloot dijkzijde;X_Teen dijk binnenwaarts;Y_Teen dijk binnenwaarts;Z_Teen dijk binnenwaarts;X_Kruin binnenberm;Y_Kruin binnenberm;Z_Kruin binnenberm;X_Insteek binnenberm;Y_Insteek binnenberm;Z_Insteek binnenberm;X_Kruin binnentalud;Y_Kruin binnentalud;Z_Kruin binnentalud;X_Verkeersbelasting kant binnenwaarts;Y_Verkeersbelasting kant binnenwaarts;Z_Verkeersbelasting kant binnenwaarts;X_Verkeersbelasting kant buitenwaarts;Y_Verkeersbelasting kant buitenwaarts;Z_Verkeersbelasting kant buitenwaarts;X_Kruin buitentalud;Y_Kruin buitentalud;Z_Kruin buitentalud;X_Insteek buitenberm;Y_Insteek buitenberm;Z_Insteek buitenberm;X_Kruin buitenberm;Y_Kruin buitenberm;Z_Kruin buitenberm;X_Teen dijk buitenwaarts;Y_Teen dijk buitenwaarts;Z_Teen dijk buitenwaarts;X_Maaiveld buitenwaarts;Y_Maaiveld buitenwaarts;Z_Maaiveld buitenwaarts;X_Dijktafelhoogte;Y_Dijktafelhoogte;Z_Dijktafelhoogte;Volgnummer @@ -48,10 +48,10 @@ public class CharacteristicPointsCsvReader : IDisposable { private const char separator = ';'; - private const string xPrefix = "x_"; private const string yPrefix = "y_"; private const string zPrefix = "z_"; + private static readonly Point3D undefinedPoint = new Point3D(-1, -1, -1); private readonly string filePath; @@ -90,7 +90,7 @@ /// Some other I/O related issue occurred, such as: path includes an incorrect /// or invalid syntax for file name, directory name, or volume label. /// There is insufficient memory to allocate a buffer for the returned string. - /// The file incompatible for importing characteristic points locations. + /// The file is incompatible for importing characteristic points locations. /// /// public int GetLocationsCount() @@ -105,17 +105,17 @@ /// /// Reads and parses the next data row to create a new instance of , - /// which will contain all the declared characteristic points for some surfaceline. + /// which will contain all the declared characteristic points for some surface line. /// - /// Return the parsed characteristic points location, or null when at the end of the file. + /// Returns the parsed characteristic points location, or null when at the end of the file. /// Thrown when a critical error has occurred, which may be caused by: /// /// The file cannot be found at specified path. /// The specified path is invalid, such as being on an unmapped drive. /// Some other I/O related issue occurred, such as: path includes an incorrect /// or invalid syntax for file name, directory name, or volume label. /// There is insufficient memory to allocate a buffer for the returned string. - /// The file incompatible for importing characteristic points. + /// The file is incompatible for importing characteristic points. /// /// /// Thrown when a parse error has occurred for the current row, which may be caused by: @@ -236,8 +236,8 @@ } /// - /// Checks whether the given is valid. A valid header has a locationid column and is followed by triplets - /// of x_{characteristic_point_type};y_{characteristic_point_type};z_{characteristic_point_type} triplets. + /// Checks whether the given is valid. A valid header has a locationid column and is followed by + /// x_{characteristic_point_type};y_{characteristic_point_type};z_{characteristic_point_type} triplets. /// /// The line which should represent the header of a characteristic point file. /// true if the is valid, false otherwise. @@ -379,14 +379,14 @@ location.BottomDitchDikeSide = GetPoint3D(tokenizedString, bottomDitchDikeSideKey, location.Name); location.DitchDikeSide = GetPoint3D(tokenizedString, ditchDikeSideKey, location.Name); location.DikeToeAtPolder = GetPoint3D(tokenizedString, dikeToeAtPolderKey, location.Name); - location.ShoulderTopInside = GetPoint3D(tokenizedString, topShoulderInsideKey, location.Name); - location.ShoulderBaseInside = GetPoint3D(tokenizedString, shoulderInsideKey, location.Name); + location.ShoulderTopInside = GetPoint3D(tokenizedString, shoulderTopInsideKey, location.Name); + location.ShoulderBaseInside = GetPoint3D(tokenizedString, shoulderBaseInsideKey, location.Name); location.DikeTopAtPolder = GetPoint3D(tokenizedString, dikeTopAtPolderKey, location.Name); location.TrafficLoadInside = GetPoint3D(tokenizedString, trafficLoadInsideKey, location.Name); location.TrafficLoadOutside = GetPoint3D(tokenizedString, trafficLoadOutsideKey, location.Name); location.DikeTopAtRiver = GetPoint3D(tokenizedString, dikeTopAtRiverKey, location.Name); - location.ShoulderBaseOutside = GetPoint3D(tokenizedString, shoulderOutsideKey, location.Name); - location.ShoulderTopOutside = GetPoint3D(tokenizedString, topShoulderOutsideKey, location.Name); + location.ShoulderBaseOutside = GetPoint3D(tokenizedString, shoulderBaseOutsideKey, location.Name); + location.ShoulderTopOutside = GetPoint3D(tokenizedString, shoulderTopOutsideKey, location.Name); location.DikeToeAtRiver = GetPoint3D(tokenizedString, dikeToeAtRiverKey, location.Name); location.SurfaceLevelOutside = GetPoint3D(tokenizedString, surfaceLevelOutsideKey, location.Name); location.DikeTableHeight = GetPoint3D(tokenizedString, dikeTableHeightKey, location.Name); @@ -476,7 +476,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The critical error message. @@ -491,7 +491,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The critical error message. @@ -505,7 +505,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The name of the location being read. @@ -532,14 +532,14 @@ private const string bottomDitchDikeSideKey = "slootbodem_dijkzijde"; private const string ditchDikeSideKey = "insteek_sloot_dijkzijde"; private const string dikeToeAtPolderKey = "teen_dijk_binnenwaarts"; - private const string topShoulderInsideKey = "kruin_binnenberm"; - private const string shoulderInsideKey = "insteek_binnenberm"; + private const string shoulderTopInsideKey = "kruin_binnenberm"; + private const string shoulderBaseInsideKey = "insteek_binnenberm"; private const string dikeTopAtPolderKey = "kruin_binnentalud"; private const string trafficLoadInsideKey = "verkeersbelasting_kant_binnenwaarts"; private const string trafficLoadOutsideKey = "verkeersbelasting_kant_buitenwaarts"; private const string dikeTopAtRiverKey = "kruin_buitentalud"; - private const string shoulderOutsideKey = "insteek_buitenberm"; - private const string topShoulderOutsideKey = "kruin_buitenberm"; + private const string shoulderBaseOutsideKey = "insteek_buitenberm"; + private const string shoulderTopOutsideKey = "kruin_buitenberm"; private const string dikeToeAtRiverKey = "teen_dijk_buitenwaarts"; private const string surfaceLevelOutsideKey = "maaiveld_buitenwaarts"; private const string dikeTableHeightKey = "dijktafelhoogte"; Index: Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvImporter.cs =================================================================== diff -u -rdf853f988ad99b935860c361bc000f6aba9876a7 -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvImporter.cs (.../SurfaceLinesCsvImporter.cs) (revision df853f988ad99b935860c361bc000f6aba9876a7) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvImporter.cs (.../SurfaceLinesCsvImporter.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -41,6 +41,7 @@ /// Id;X1;Y1;Z1;...(Xn;Yn;Zn) /// Where Xn;Yn;Zn form the n-th 3D point describing the geometry of the surface line. /// + /// The type of surface lines to import. public class SurfaceLinesCsvImporter : FileImporterBase> where T : class, IMechanismSurfaceLine { private const string characteristicPointsFileSubExtension = ".krp"; @@ -57,7 +58,7 @@ /// The import target. /// The path to the file to import from. /// The message provider to provide messages during importer actions. - /// + /// The mechanism specific configuration containing all necessary surface lines components. /// Thrown when any of the input parameters is null. public SurfaceLinesCsvImporter( ObservableUniqueItemCollectionWithSourcePath importTarget, @@ -74,6 +75,7 @@ { throw new ArgumentNullException(nameof(configuration)); } + this.messageProvider = messageProvider; surfaceLineUpdateStrategy = configuration.UpdateStrategy; updatedInstances = Enumerable.Empty(); @@ -103,7 +105,7 @@ catch (SurfaceLineTransformException e) { Log.ErrorFormat(RingtoetsCommonIOResources.SurfaceLinesCsvImporter_CriticalErrorMessage_0_File_Skipped, - e.Message); + e.Message); return false; } @@ -264,7 +266,7 @@ /// /// The list to add the valid to. /// The reader to read the from. - /// already contains a + /// Thrown when already contains a /// with the same name as the new . private void AddValidSurfaceLineToCollection(List list, SurfaceLinesCsvReader reader) { @@ -418,7 +420,7 @@ /// /// The list to add the valid to. /// The reader to read the from. - /// already contains a + /// Thrown when already contains a /// with the same name as the new . private void AddValidCharacteristicPointsLocationToCollection(ICollection list, CharacteristicPointsCsvReader reader) { Index: Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvReader.cs =================================================================== diff -u -rb8fa5d6867c945f3f1744fd1455b89cadb357959 -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvReader.cs (.../SurfaceLinesCsvReader.cs) (revision b8fa5d6867c945f3f1744fd1455b89cadb357959) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SurfaceLines/SurfaceLinesCsvReader.cs (.../SurfaceLinesCsvReader.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -37,11 +37,11 @@ { /// /// File reader for a plain text file in comma-separated values format (*.csv), containing - /// data specifying surfacelines. + /// data specifying surface lines. /// Expects data to be specified in the following format: /// {ID};X1;Y1;Z1...;(Xn;Yn;Zn) /// Where {ID} has to be a particular accepted text, and n triplets of doubles form the - /// 3D coordinates defining the geometric shape of the surfaceline. + /// 3D coordinates defining the geometric shape of the surface line. /// public class SurfaceLinesCsvReader : IDisposable { @@ -69,11 +69,10 @@ private int startGeometryColumnIndex; /// - /// Initializes a new instance of the class - /// and opens a given file path. + /// Initializes a new instance of the class. /// /// The path to the file to be read. - /// is invalid. + /// Thrown when is invalid. public SurfaceLinesCsvReader(string path) { IOUtils.ValidateFilePath(path); @@ -86,14 +85,14 @@ /// data rows. /// /// A value greater than or equal to 0. - /// A critical error has occurred, which may be caused by: + /// Thrown when a critical error has occurred, which may be caused by: /// /// The file cannot be found at specified path. /// The specified path is invalid, such as being on an unmapped drive. /// Some other I/O related issue occurred, such as: path includes an incorrect /// or invalid syntax for file name, directory name, or volume label. /// There is insufficient memory to allocate a buffer for the returned string. - /// The file incompatible for importing surface lines. + /// The file is incompatible for importing surface lines. /// /// public int GetSurfaceLinesCount() @@ -110,18 +109,18 @@ /// Reads and consumes the next data row which contains a surface line, parsing the data to create an instance /// of . /// - /// Return the parsed surfaceline, or null when at the end of the file. - /// A critical error has occurred, which may be caused by: + /// Returns the parsed surface line, or null when at the end of the file. + /// Thrown when a critical error has occurred, which may be caused by: /// /// The file cannot be found at specified path. /// The specified path is invalid, such as being on an unmapped drive. /// Some other I/O related issue occurred, such as: path includes an incorrect /// or invalid syntax for file name, directory name, or volume label. /// There is insufficient memory to allocate a buffer for the returned string. - /// The file incompatible for importing surface lines. + /// The file is incompatible for importing surface lines. /// /// - /// A parse error has occurred for the current row, which may be caused by: + /// Thrown when a parse error has occurred for the current row, which may be caused by: /// /// The row doesn't use ';' as separator character. /// The row contains a coordinate value that cannot be parsed as a double. @@ -216,7 +215,7 @@ /// /// The text. /// The tokenized parts. - /// lacks separator character. + /// Thrown when lacks a separator character. private string[] TokenizeString(string readText) { if (!readText.Contains(separator)) @@ -235,7 +234,7 @@ /// The tokenized string. /// The name of the surface line for which geometry points are retrieved. /// Set of all 3D world coordinate points. - /// A parse error has occurred for the current row, which may be caused by: + /// Thrown when a parse error has occurred for the current row, which may be caused by: /// /// contains a coordinate value that cannot be parsed as a double. /// contains a number that is too big or too small to be represented with a double. @@ -269,7 +268,7 @@ /// /// The tokenized string from which the name should be extracted. /// The name of the surface line. - /// Id value is null or empty. + /// Thrown when id value is null or empty. private string GetSurfaceLineName(IList tokenizedString) { string name = tokenizedString.Any() ? tokenizedString[idNameColumnIndex].Trim() : string.Empty; @@ -286,7 +285,7 @@ /// The tokenized string. /// The name of the surface line whose coordinate values are being parsed. /// - /// A parse error has occurred for the current row, which may be caused by: + /// Thrown when a parse error has occurred for the current row, which may be caused by: /// /// The row contains a coordinate value that cannot be parsed as a double. /// The row contains a number that is too big or too small to be represented with a double. @@ -315,7 +314,7 @@ /// /// The reader, which is currently at the header row. /// Row index used in error messaging. - /// The header is not in the required format. + /// Thrown when the header is not in the required format. private void ValidateHeader(TextReader reader, int currentLine) { string header = ReadLineAndHandleIOExceptions(reader, currentLine); @@ -333,7 +332,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The critical error message. @@ -348,7 +347,7 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. /// The critical error message. @@ -362,10 +361,10 @@ } /// - /// Throws a configured instance of . + /// Creates a configured instance of . /// /// The line number being read. - /// The name of the surfaceline being read. + /// The name of the surface line being read. /// The critical error message. /// Optional: exception that caused this exception to be thrown. /// New with message and inner exceptions set. @@ -384,8 +383,8 @@ /// /// The reader at the row from which counting should start. /// The current line, used for error messaging. - /// An integer greater than or equal to 0, being the number of surfaceline rows. - /// An I/O exception occurred. + /// An integer greater than or equal to 0, being the number of surface line rows. + /// Thrown when an I/O exception occurred. private int CountNonEmptyLines(TextReader reader, int currentLine) { var count = 0; @@ -408,7 +407,7 @@ /// 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. + /// Thrown when an critical I/O exception occurred. private string ReadLineAndHandleIOExceptions(TextReader reader, int currentLine) { try Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs =================================================================== diff -u -r5579d8fdef4f553fb4ba94160825ec960b89bab9 -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision 5579d8fdef4f553fb4ba94160825ec960b89bab9) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -115,7 +115,7 @@ } [Test] - public void GetLocationsCount_FileCannotBeFound_ThrowCriticalFileReadException() + public void GetLocationsCount_FileCannotBeFound_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "I_do_not_exist.csv"); @@ -137,7 +137,7 @@ } [Test] - public void GetLocationsCount_DirectoryCannotBeFound_ThrowCriticalFileReadException() + public void GetLocationsCount_DirectoryCannotBeFound_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "..", "this_folder_does_not_exist", "I_do_not_exist.csv"); @@ -159,7 +159,7 @@ } [Test] - public void GetLocationsCount_EmptyFile_ThrowCriticalFileReadException() + public void GetLocationsCount_EmptyFile_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "empty.krp.csv"); @@ -188,7 +188,7 @@ [TestCase("start_order_number")] [TestCase("middle_order_number")] [TestCase("end_order_number")] - public void GetLocationsCount_FileHasColumnsMissingInHeader_ThrowCriticalFileReadException(string malformattedVariableName) + public void GetLocationsCount_FileHasColumnsMissingInHeader_ThrowsCriticalFileReadException(string malformattedVariableName) { // Setup string path = Path.Combine(testDataPath, $"1location_column_missing_{malformattedVariableName}.krp.csv"); @@ -211,7 +211,7 @@ } [Test] - public void GetLocationsCount_InvalidHeader_ThrowCriticalFileReadException() + public void GetLocationsCount_InvalidHeader_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "1location_invalid_header.krp.csv"); @@ -234,7 +234,7 @@ } [Test] - public void GetLocationsCount_DuplicateColumnsInHeader_ThrowCriticalFileReadException() + public void GetLocationsCount_DuplicateColumnsInHeader_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "2locations_header_duplicate_columns.krp.csv"); @@ -302,7 +302,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_FileCannotBeFound_ThrowCriticalFileReadException() + public void ReadCharacteristicPointsLocation_FileCannotBeFound_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "I_do_not_exist.csv"); @@ -324,7 +324,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_DirectoryCannotBeFound_ThrowCriticalFileReadException() + public void ReadCharacteristicPointsLocation_DirectoryCannotBeFound_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "..", "this_folder_does_not_exist", "I_do_not_exist.csv"); @@ -346,7 +346,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_EmptyFile_ThrowCriticalFileReadException() + public void ReadCharacteristicPointsLocation_EmptyFile_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "empty.krp.csv"); @@ -369,7 +369,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_InvalidHeader_ThrowCriticalFileReadException() + public void ReadCharacteristicPointsLocation_InvalidHeader_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "1location_invalid_header.krp.csv"); @@ -392,7 +392,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_DuplicateColumnsInHeader_ThrowCriticalFileReadException() + public void ReadCharacteristicPointsLocation_DuplicateColumnsInHeader_ThrowsCriticalFileReadException() { // Setup string path = Path.Combine(testDataPath, "2locations_header_duplicate_columns.krp.csv"); @@ -415,7 +415,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_FileHasInvalidCoordinate_ThrowLineParseException() + public void ReadCharacteristicPointsLocation_FileHasInvalidCoordinate_ThrowsLineParseException() { // Setup string path = Path.Combine(testDataPath, "1location_invalid_double.krp.csv"); @@ -446,7 +446,7 @@ [TestCase("underflow_x")] [TestCase("underflow_y")] [TestCase("underflow_z")] - public void ReadCharacteristicPointsLocation_FileHasCoordinateCausingOverOrUnderflow_ThrowLineParseException(string malformattedVariableName) + public void ReadCharacteristicPointsLocation_FileHasCoordinateCausingOverOrUnderflow_ThrowsLineParseException(string malformattedVariableName) { // Setup string path = Path.Combine(testDataPath, string.Format("1location_{0}.krp.csv", malformattedVariableName)); @@ -471,7 +471,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_FileLacksIds_ThrowLineParseException() + public void ReadCharacteristicPointsLocation_FileLacksIds_ThrowsLineParseException() { // Setup string path = Path.Combine(testDataPath, "2locations_each_missing_id.krp.csv"); @@ -502,7 +502,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_FileLacksIdsWithWhiteLine_ThrowLineParseExceptionOnCorrectLine() + public void ReadCharacteristicPointsLocation_FileLacksIdsWithWhiteLine_ThrowsLineParseExceptionOnCorrectLine() { // Setup string path = Path.Combine(testDataPath, "2locations_each_missing_id_with_white_line.krp.csv"); @@ -533,7 +533,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_IncorrectValueSeparator_ThrowLineParseException() + public void ReadCharacteristicPointsLocation_IncorrectValueSeparator_ThrowsLineParseException() { // Setup string path = Path.Combine(testDataPath, "2locations_invalid_separator.krp.csv"); @@ -556,7 +556,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_FileHasIncompleteCoordinateTriplets_ThrowLineParseException() + public void ReadCharacteristicPointsLocation_FileHasIncompleteCoordinateTriplets_ThrowsLineParseException() { // Setup string path = Path.Combine(testDataPath, "2locations_each_missing_values.krp.csv"); @@ -589,7 +589,7 @@ } [Test] - public void ReadCharacteristicPointsLocation_FileHasTooManyValues_ThrowLineParseException() + public void ReadCharacteristicPointsLocation_FileHasTooManyValues_ThrowsLineParseException() { // Setup string path = Path.Combine(testDataPath, "2locations_each_too_many_values.krp.csv"); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvImporterTest.cs =================================================================== diff -u -r683ff9234262d9fa3bea5edc0abe35254f80e49d -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvImporterTest.cs (.../SurfaceLinesCsvImporterTest.cs) (revision 683ff9234262d9fa3bea5edc0abe35254f80e49d) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SurfaceLines/SurfaceLinesCsvImporterTest.cs (.../SurfaceLinesCsvImporterTest.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -64,7 +64,7 @@ } [Test] - public void Constructor_ObservableListNull_ThrowsArgumentNullException() + public void Constructor_ImportTargetNull_ThrowsArgumentNullException() { // Setup var messageProvider = mocks.Stub(); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/RingtoetsMacroStabilityInwardsSurfaceLine.cs =================================================================== diff -u -r6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/RingtoetsMacroStabilityInwardsSurfaceLine.cs (.../RingtoetsMacroStabilityInwardsSurfaceLine.cs) (revision 6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Primitives/RingtoetsMacroStabilityInwardsSurfaceLine.cs (.../RingtoetsMacroStabilityInwardsSurfaceLine.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -146,7 +146,7 @@ /// /// Gets the location which generalizes the surface level on the - /// inside of the polder + /// inside of the polder. /// public Point3D SurfaceLevelInside { get; private set; } @@ -562,7 +562,7 @@ SurfaceLevelOutside = PointFromGeometryOrNull(fromSurfaceLine.SurfaceLevelOutside); TrafficLoadOutside = PointFromGeometryOrNull(fromSurfaceLine.TrafficLoadOutside); TrafficLoadInside = PointFromGeometryOrNull(fromSurfaceLine.TrafficLoadInside); - DikeToeAtPolder = PointFromGeometryOrNull(fromSurfaceLine.DikeToeAtPolder); + DikeTopAtPolder = PointFromGeometryOrNull(fromSurfaceLine.DikeTopAtPolder); ShoulderBaseInside = PointFromGeometryOrNull(fromSurfaceLine.ShoulderBaseInside); ShoulderTopInside = PointFromGeometryOrNull(fromSurfaceLine.ShoulderTopInside); BottomDitchDikeSide = PointFromGeometryOrNull(fromSurfaceLine.BottomDitchDikeSide); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLinePropertiesTest.cs =================================================================== diff -u -re6106ea248df5d48159b78e37bb533856d2ebce7 -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLinePropertiesTest.cs (.../RingtoetsMacroStabilityInwardsSurfaceLinePropertiesTest.cs) (revision e6106ea248df5d48159b78e37bb533856d2ebce7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/RingtoetsMacroStabilityInwardsSurfaceLinePropertiesTest.cs (.../RingtoetsMacroStabilityInwardsSurfaceLinePropertiesTest.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -90,7 +90,7 @@ surfaceLine.SetTrafficLoadOutsideAt(point5); surfaceLine.SetTrafficLoadInsideAt(point6); surfaceLine.SetShoulderTopInsideAt(point7); - surfaceLine.SetDikeTopAtPolderAt(point8); + surfaceLine.SetDikeToeAtPolderAt(point8); surfaceLine.SetDitchDikeSideAt(point9); surfaceLine.SetBottomDitchDikeSideAt(point10); surfaceLine.SetBottomDitchPolderSideAt(point11); @@ -112,7 +112,7 @@ Assert.AreEqual(surfaceLine.TrafficLoadOutside, properties.TrafficLoadOutside); Assert.AreEqual(surfaceLine.TrafficLoadInside, properties.TrafficLoadInside); Assert.AreEqual(surfaceLine.ShoulderTopInside, properties.ShoulderTopInside); - Assert.AreEqual(surfaceLine.DikeTopAtPolder, properties.DikeTopAtPolder); + Assert.AreEqual(surfaceLine.DikeToeAtPolder, properties.DikeToeAtPolder); Assert.AreEqual(surfaceLine.DitchDikeSide, properties.DitchDikeSide); Assert.AreEqual(surfaceLine.BottomDitchDikeSide, properties.BottomDitchDikeSide); Assert.AreEqual(surfaceLine.BottomDitchPolderSide, properties.BottomDitchPolderSide); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/RingtoetsMacroStabilityInwardsSurfaceLineTest.cs =================================================================== diff -u -r6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/RingtoetsMacroStabilityInwardsSurfaceLineTest.cs (.../RingtoetsMacroStabilityInwardsSurfaceLineTest.cs) (revision 6483bd7c2aef66cc8ae0879ba2b2b261aa0cb32a) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.Test/RingtoetsMacroStabilityInwardsSurfaceLineTest.cs (.../RingtoetsMacroStabilityInwardsSurfaceLineTest.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -159,7 +159,7 @@ } [Test] - public void GetZAtL_GeometryIsEmpty_ThrowInvalidOperationException() + public void GetZAtL_GeometryIsEmpty_ThrowsInvalidOperationException() { // Setup var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); @@ -201,7 +201,7 @@ [TestCase(-5e-3)] [TestCase(3.1 + 5e-3)] [TestCase(4.0)] - public void GetZAtL_SurfaceLineDoesNotContainsPointAtL_ThrowsArgumentOutOfRange(double l) + public void GetZAtL_SurfaceLineDoesNotContainsPointAtL_ThrowsArgumentOutOfRangeException(double l) { // Setup double testZ = new Random(22).NextDouble(); @@ -474,7 +474,7 @@ } [Test] - public void Equal_SameReference_ReturnsTrue() + public void Equals_SameReference_ReturnsTrue() { // Setup var surfaceLineOne = new RingtoetsMacroStabilityInwardsSurfaceLine(); @@ -878,6 +878,62 @@ Assert.AreEqual(hashCodeOne, hashCodeTwo); } + public abstract class SetCharacteristicPointTest + { + [Test] + public void PointInGeometry_PointSetFromGeometry() + { + // Setup + const double testX = 1.0; + const double testY = 2.2; + const double testZ = 4.4; + var testPoint = new Point3D(testX, testY, testZ); + var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + CreateTestGeometry(testPoint, surfaceLine); + + // Call + SetCharacteristicPoint(surfaceLine, testPoint); + + // Assert + Assert.AreEqual(testPoint, GetCharacteristicPoint(surfaceLine)); + Assert.AreNotSame(testPoint, GetCharacteristicPoint(surfaceLine)); + } + + [Test] + public void GeometryEmpty_ThrowsInvalidOperationException() + { + // Setup + var random = new Random(21); + var testPoint = new Point3D(random.NextDouble(), random.NextDouble(), random.NextDouble()); + var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate test = () => SetCharacteristicPoint(surfaceLine, testPoint); + + // Assert + string expectedMessage = $"De geometrie bevat geen punt op locatie {testPoint} om als '{CharacteristicPointDescription()}' in te stellen."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + [Test] + public void Null_ThrowsArgumentNullException() + { + // Setup + var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); + + // Call + TestDelegate test = () => SetCharacteristicPoint(surfaceLine, null); + + // Assert + const string expectedMessage = "Cannot find a point in geometry using a null point."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + } + + protected abstract void SetCharacteristicPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point); + protected abstract Point3D GetCharacteristicPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine); + protected abstract string CharacteristicPointDescription(); + } + [TestFixture] public class SetDitchPolderSideAtTest : SetCharacteristicPointTest { @@ -1125,62 +1181,6 @@ } } - public abstract class SetCharacteristicPointTest - { - [Test] - public void PointInGeometry_PointSetFromGeometry() - { - // Setup - const double testX = 1.0; - const double testY = 2.2; - const double testZ = 4.4; - var testPoint = new Point3D(testX, testY, testZ); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); - CreateTestGeometry(testPoint, surfaceLine); - - // Call - SetCharacteristicPoint(surfaceLine, testPoint); - - // Assert - Assert.AreEqual(testPoint, GetCharacteristicPoint(surfaceLine)); - Assert.AreNotSame(testPoint, GetCharacteristicPoint(surfaceLine)); - } - - [Test] - public void GeometryEmpty_ThrowsInvalidOperationException() - { - // Setup - var random = new Random(21); - var testPoint = new Point3D(random.NextDouble(), random.NextDouble(), random.NextDouble()); - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); - - // Call - TestDelegate test = () => SetCharacteristicPoint(surfaceLine, testPoint); - - // Assert - string expectedMessage = $"De geometrie bevat geen punt op locatie {testPoint} om als '{CharacteristicPointDescription()}' in te stellen."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - [Test] - public void Null_ThrowsArgumentNullException() - { - // Setup - var surfaceLine = new RingtoetsMacroStabilityInwardsSurfaceLine(); - - // Call - TestDelegate test = () => SetCharacteristicPoint(surfaceLine, null); - - // Assert - const string expectedMessage = "Cannot find a point in geometry using a null point."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); - } - - protected abstract void SetCharacteristicPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine, Point3D point); - protected abstract Point3D GetCharacteristicPoint(RingtoetsMacroStabilityInwardsSurfaceLine surfaceLine); - protected abstract string CharacteristicPointDescription(); - } - private class TestSurfaceLine : RingtoetsMacroStabilityInwardsSurfaceLine { public TestSurfaceLine(RingtoetsMacroStabilityInwardsSurfaceLine profile) @@ -1251,7 +1251,7 @@ surfaceLine.SetSurfaceLevelOutsideAt(geometry[0]); surfaceLine.SetTrafficLoadOutsideAt(geometry[1]); surfaceLine.SetTrafficLoadInsideAt(geometry[2]); - surfaceLine.SetDikeToeAtPolderAt(geometry[3]); + surfaceLine.SetDikeTopAtPolderAt(geometry[3]); surfaceLine.SetShoulderBaseInsideAt(geometry[4]); surfaceLine.SetShoulderTopInsideAt(geometry[5]); surfaceLine.SetBottomDitchDikeSideAt(geometry[6]); Index: Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/RingtoetsPipingSurfaceLineTest.cs =================================================================== diff -u -rec27d9f02dc27c2829ed45788fae7d5923d63d3d -r25772ddfd0a02f2fb7633bf69d114106900f5bb0 --- Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision ec27d9f02dc27c2829ed45788fae7d5923d63d3d) +++ Ringtoets/Piping/test/Ringtoets.Piping.Primitives.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision 25772ddfd0a02f2fb7633bf69d114106900f5bb0) @@ -159,7 +159,7 @@ } [Test] - public void GetZAtL_GeometryIsEmpty_ThrowInvalidOperationException() + public void GetZAtL_GeometryIsEmpty_ThrowsInvalidOperationException() { // Setup var surfaceLine = new RingtoetsPipingSurfaceLine(); @@ -201,7 +201,7 @@ [TestCase(-5e-3)] [TestCase(3.1 + 5e-3)] [TestCase(4.0)] - public void GetZAtL_SurfaceLineDoesNotContainsPointAtL_ThrowsArgumentOutOfRange(double l) + public void GetZAtL_SurfaceLineDoesNotContainsPointAtL_ThrowsArgumentOutOfRangeException(double l) { // Setup double testZ = new Random(22).NextDouble(); @@ -474,7 +474,7 @@ } [Test] - public void Equal_SameReference_ReturnsTrue() + public void Equals_SameReference_ReturnsTrue() { // Setup var surfaceLineOne = new RingtoetsPipingSurfaceLine(); @@ -752,14 +752,6 @@ Assert.AreEqual(hashCodeOne, hashCodeTwo); } - private class TestSurfaceLine : RingtoetsPipingSurfaceLine - { - public TestSurfaceLine(RingtoetsPipingSurfaceLine profile) - { - CopyProperties(profile); - } - } - public abstract class SetCharacteristicPointTest { [Test] @@ -930,6 +922,14 @@ } } + private class TestSurfaceLine : RingtoetsPipingSurfaceLine + { + public TestSurfaceLine(RingtoetsPipingSurfaceLine profile) + { + CopyProperties(profile); + } + } + private static RingtoetsPipingSurfaceLine CreateSurfaceLineWithCharacteristicPoints() { var surfaceLine = new RingtoetsPipingSurfaceLine