Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLine.cs
===================================================================
diff -u -r1abce3b7d9611e826388ff49f3faf8cb1040f80c -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision 1abce3b7d9611e826388ff49f3faf8cb1040f80c)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/RingtoetsPipingSurfaceLine.cs (.../RingtoetsPipingSurfaceLine.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -96,42 +96,14 @@
public Point3D DitchDikeSide { get; private set; }
///
- /// Gets or sets the L-coördinate of the entry point.
+ /// Gets the point which is the entry point for piping.
///
- /// is not in range of the LZ-projected .
- /// is empty.
- public double EntryPointL
- {
- get
- {
- return entryPointL;
- }
- set
- {
- ValidateHasPoints();
- ValidateInRange(value, ProjectGeometryToLZ().ToArray(), Resources.RingtoetsPipingSurfaceLine_EntryPointL_Cannot_set_entry_point_at_L_0);
- entryPointL = value;
- }
- }
+ public Point3D EntryPoint { get; private set; }
///
- /// Gets or sets the L-coördinate of the exit point.
+ /// Gets the point which is the exit point for piping.
///
- /// is not in range of the LZ-projected .
- /// is empty.
- public double ExitPointL
- {
- get
- {
- return exitPointL;
- }
- set
- {
- ValidateHasPoints();
- ValidateInRange(value, ProjectGeometryToLZ().ToArray(), Resources.RingtoetsPipingSurfaceLine_ExitPointL_Cannot_set_exit_point_at_L_0);
- exitPointL = value;
- }
- }
+ public Point3D ExitPoint { get; private set; }
///
/// Sets the geometry of the surfaceline.
@@ -206,6 +178,30 @@
}
///
+ /// Sets the at the given point.
+ ///
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
+ /// .
+ /// is null.
+ public void SetEntryPointAt(Point3D point)
+ {
+ EntryPoint = GetPointFromGeometry(point);
+ }
+
+ ///
+ /// Sets the at the given point.
+ ///
+ /// The location as a which to set as the .
+ /// Thrown when doesn't contain a at
+ /// .
+ /// is null.
+ public void SetExitPointAt(Point3D point)
+ {
+ ExitPoint = GetPointFromGeometry(point);
+ }
+
+ ///
/// Finds a point from which is at the same position as .
///
/// The location of a point from .
@@ -217,7 +213,7 @@
{
if (point == null)
{
- throw new ArgumentNullException("Cannot find a point in geometry using a null point.");
+ throw new ArgumentNullException("point", "Cannot find a point in geometry using a null point.");
}
var pointFromGeometry = Points.FirstOrDefault(p => p.Equals(point));
if (pointFromGeometry == null)
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r5fc981700e34ae08fff93a9a2207e2edde02213b -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 5fc981700e34ae08fff93a9a2207e2edde02213b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -71,6 +71,15 @@
}
///
+ /// Looks up a localized string similar to Karakteristieke punten.
+ ///
+ public static string Categories_Characteristic_points {
+ get {
+ return ResourceManager.GetString("Categories_Characteristic_points", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Algemeen.
///
public static string Categories_General {
@@ -1339,7 +1348,7 @@
}
///
- /// Looks up a localized string similar to De x-coördinaat van het intredepunt..
+ /// Looks up a localized string similar to Het punt van intrede voor piping..
///
public static string RingtoetsPipingSurfaceLine_EntryPointL_Description {
get {
@@ -1357,7 +1366,7 @@
}
///
- /// Looks up a localized string similar to De x-coördinaat van het uittredepunt..
+ /// Looks up a localized string similar to Het punt van uittrede voor piping..
///
public static string RingtoetsPipingSurfaceLine_ExitPointL_Description {
get {
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx
===================================================================
diff -u -r5fc981700e34ae08fff93a9a2207e2edde02213b -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision 5fc981700e34ae08fff93a9a2207e2edde02213b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -560,15 +560,18 @@
Insteek sloot polderzijde
- De x-coördinaat van het intredepunt.
+ Het punt van intrede voor piping.
Intredepunt
- De x-coördinaat van het uittredepunt.
+ Het punt van uittrede voor piping.
Uittredepunt
+
+ Karakteristieke punten
+
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/RingtoetsPipingSurfaceLineProperties.cs
===================================================================
diff -u -r5fc981700e34ae08fff93a9a2207e2edde02213b -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/RingtoetsPipingSurfaceLineProperties.cs (.../RingtoetsPipingSurfaceLineProperties.cs) (revision 5fc981700e34ae08fff93a9a2207e2edde02213b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/RingtoetsPipingSurfaceLineProperties.cs (.../RingtoetsPipingSurfaceLineProperties.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -50,26 +50,29 @@
}
}
+ [ResourcesCategory(typeof(Resources), "Categories_Characteristic_points")]
[ResourcesDisplayName(typeof(Resources), "RingtoetsPipingSurfaceLine_EntryPointL_DisplayName")]
[ResourcesDescription(typeof(Resources), "RingtoetsPipingSurfaceLine_EntryPointL_Description")]
- public double EntryPointL
+ public Point3D EntryPoint
{
get
{
- return data.EntryPointL;
+ return data.EntryPoint;
}
}
+ [ResourcesCategory(typeof(Resources), "Categories_Characteristic_points")]
[ResourcesDisplayName(typeof(Resources), "RingtoetsPipingSurfaceLine_ExitPointL_DisplayName")]
[ResourcesDescription(typeof(Resources), "RingtoetsPipingSurfaceLine_ExitPointL_Description")]
- public double ExitPointL
+ public Point3D ExitPoint
{
get
{
- return data.ExitPointL;
+ return data.ExitPoint;
}
}
+ [ResourcesCategory(typeof(Resources), "Categories_Characteristic_points")]
[ResourcesDisplayName(typeof(Resources), "RingtoetsPipingSurfaceLine_DitchDikeSide_DisplayName")]
[ResourcesDescription(typeof(Resources), "RingtoetsPipingSurfaceLine_DitchDikeSide_Description")]
public Point3D DitchDikeSide
@@ -80,6 +83,7 @@
}
}
+ [ResourcesCategory(typeof(Resources), "Categories_Characteristic_points")]
[ResourcesDisplayName(typeof(Resources), "RingtoetsPipingSurfaceLine_BottomDitchDikeSide_DisplayName")]
[ResourcesDescription(typeof(Resources), "RingtoetsPipingSurfaceLine_BottomDitchDikeSide_Description")]
public Point3D BottomDitchDikeSide
@@ -90,6 +94,7 @@
}
}
+ [ResourcesCategory(typeof(Resources), "Categories_Characteristic_points")]
[ResourcesDisplayName(typeof(Resources), "RingtoetsPipingSurfaceLine_BottomDitchPolderSide_DisplayName")]
[ResourcesDescription(typeof(Resources), "RingtoetsPipingSurfaceLine_BottomDitchPolderSide_Description")]
public Point3D BottomDitchPolderSide
@@ -100,6 +105,7 @@
}
}
+ [ResourcesCategory(typeof(Resources), "Categories_Characteristic_points")]
[ResourcesDisplayName(typeof(Resources), "RingtoetsPipingSurfaceLine_DitchPolderSide_DisplayName")]
[ResourcesDescription(typeof(Resources), "RingtoetsPipingSurfaceLine_DitchPolderSide_Description")]
public Point3D DitchPolderSide
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs
===================================================================
diff -u -rfea3332b5f7a5cea6b41de4a6368c1f1c2bf1282 -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision fea3332b5f7a5cea6b41de4a6368c1f1c2bf1282)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -61,114 +61,113 @@
}
///
- /// Looks up a localized string similar to Er kan geen 1D-profiel bepaald worden wanneer segmenten in een 2D laag verticaal lopen op de gekozen positie: x = {0}..
+ /// Looks up a localized string similar to Het bestand is niet geschikt om karakteristieke punten uit te lezen: koptekst komt niet overeen met wat verwacht wordt..
///
- public static string Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_ {
+ public static string CharacteristicPointsCsvReader_File_invalid_header {
get {
- return ResourceManager.GetString("Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_", resourceCulture);
+ return ResourceManager.GetString("CharacteristicPointsCsvReader_File_invalid_header", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Karakteristiek punt heeft een coördinaatwaarde die niet omgezet kan worden naar een getal..
+ /// Looks up a localized string similar to locatie '{0}'.
///
- public static string Error_CharacteristicPoint_has_not_double {
+ public static string CharacteristicPointsCsvReader_LocationName_0_ {
get {
- return ResourceManager.GetString("Error_CharacteristicPoint_has_not_double", resourceCulture);
+ return ResourceManager.GetString("CharacteristicPointsCsvReader_LocationName_0_", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Karakteristiek punt heeft een coördinaatwaarde die te groot of te klein is om ingelezen te worden..
+ /// Looks up a localized string similar to Regel heeft geen ID..
///
- public static string Error_CharacteristicPoint_parsing_causes_overflow {
+ public static string CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID {
get {
- return ResourceManager.GetString("Error_CharacteristicPoint_parsing_causes_overflow", resourceCulture);
+ return ResourceManager.GetString("CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Kon geen ondergrond profielen verkrijgen van de database..
+ /// Looks up a localized string similar to Regel ontbreekt het verwachte scheidingsteken (het karakter: {0})..
///
- public static string Error_SoilProfile_read_from_database {
+ public static string CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_ {
get {
- return ResourceManager.GetString("Error_SoilProfile_read_from_database", resourceCulture);
+ return ResourceManager.GetString("CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separat" +
+ "or_0_", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Geen geldige X waarde gevonden om intersectie te maken uit 2D profiel '{0}'..
+ /// Looks up a localized string similar to De locatie heeft een incorrect aantal kolommen..
///
- public static string Error_SoilProfileBuilder_cant_determine_intersect_SoilProfileName_0_at_double_NaN {
+ public static string CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points {
get {
- return ResourceManager.GetString("Error_SoilProfileBuilder_cant_determine_intersect_SoilProfileName_0_at_double_NaN" +
- "", resourceCulture);
+ return ResourceManager.GetString("CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_val" +
+ "ues_for_characteristic_points", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Profielmeting heeft een coördinaatwaarde die niet omgezet kan worden naar een getal..
+ /// Looks up a localized string similar to Er kan geen 1D-profiel bepaald worden wanneer segmenten in een 2D laag verticaal lopen op de gekozen positie: x = {0}..
///
- public static string Error_SurfaceLine_has_not_double {
+ public static string Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_ {
get {
- return ResourceManager.GetString("Error_SurfaceLine_has_not_double", resourceCulture);
+ return ResourceManager.GetString("Error_Can_not_determine_1D_profile_with_vertical_segments_at_X_0_", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Profielmeting heeft een coördinaatwaarde die te groot of te klein is om ingelezen te worden..
+ /// Looks up a localized string similar to Karakteristiek punt heeft een coördinaatwaarde die niet omgezet kan worden naar een getal..
///
- public static string Error_SurfaceLine_parsing_causes_overflow {
+ public static string Error_CharacteristicPoint_has_not_double {
get {
- return ResourceManager.GetString("Error_SurfaceLine_parsing_causes_overflow", resourceCulture);
+ return ResourceManager.GetString("Error_CharacteristicPoint_has_not_double", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Het bestand is niet geschikt om karakteristieke punten uit te lezen: koptekst komt niet overeen met wat verwacht wordt..
+ /// Looks up a localized string similar to Karakteristiek punt heeft een coördinaatwaarde die te groot of te klein is om ingelezen te worden..
///
- public static string PipingCharacteristicPointsCsvReader_File_invalid_header {
+ public static string Error_CharacteristicPoint_parsing_causes_overflow {
get {
- return ResourceManager.GetString("PipingCharacteristicPointsCsvReader_File_invalid_header", resourceCulture);
+ return ResourceManager.GetString("Error_CharacteristicPoint_parsing_causes_overflow", resourceCulture);
}
}
///
- /// Looks up a localized string similar to locatie '{0}'.
+ /// Looks up a localized string similar to Kon geen ondergrond profielen verkrijgen van de database..
///
- public static string PipingCharacteristicPointsCsvReader_LocationName_0_ {
+ public static string Error_SoilProfile_read_from_database {
get {
- return ResourceManager.GetString("PipingCharacteristicPointsCsvReader_LocationName_0_", resourceCulture);
+ return ResourceManager.GetString("Error_SoilProfile_read_from_database", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Regel heeft geen ID..
+ /// Looks up a localized string similar to Geen geldige X waarde gevonden om intersectie te maken uit 2D profiel '{0}'..
///
- public static string PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID {
+ public static string Error_SoilProfileBuilder_cant_determine_intersect_SoilProfileName_0_at_double_NaN {
get {
- return ResourceManager.GetString("PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_I" +
- "D", resourceCulture);
+ return ResourceManager.GetString("Error_SoilProfileBuilder_cant_determine_intersect_SoilProfileName_0_at_double_NaN" +
+ "", resourceCulture);
}
}
///
- /// Looks up a localized string similar to Regel ontbreekt het verwachte scheidingsteken (het karakter: {0})..
+ /// Looks up a localized string similar to Profielmeting heeft een coördinaatwaarde die niet omgezet kan worden naar een getal..
///
- public static string PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_ {
+ public static string Error_SurfaceLine_has_not_double {
get {
- return ResourceManager.GetString("PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_s" +
- "eparator_0_", resourceCulture);
+ return ResourceManager.GetString("Error_SurfaceLine_has_not_double", resourceCulture);
}
}
///
- /// Looks up a localized string similar to De locatie heeft een incorrect aantal kolommen..
+ /// Looks up a localized string similar to Profielmeting heeft een coördinaatwaarde die te groot of te klein is om ingelezen te worden..
///
- public static string PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points {
+ public static string Error_SurfaceLine_parsing_causes_overflow {
get {
- return ResourceManager.GetString("PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lac" +
- "ks_values_for_characteristic_points", resourceCulture);
+ return ResourceManager.GetString("Error_SurfaceLine_parsing_causes_overflow", resourceCulture);
}
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx
===================================================================
diff -u -rfea3332b5f7a5cea6b41de4a6368c1f1c2bf1282 -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx (.../Resources.resx) (revision fea3332b5f7a5cea6b41de4a6368c1f1c2bf1282)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx (.../Resources.resx) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -180,7 +180,7 @@
ondergrondschematisering '{0}'
-
+
Het bestand is niet geschikt om karakteristieke punten uit te lezen: koptekst komt niet overeen met wat verwacht wordt.
@@ -189,16 +189,16 @@
Karakteristiek punt heeft een coördinaatwaarde die te groot of te klein is om ingelezen te worden.
-
+
locatie '{0}'
-
+
Regel heeft geen ID.
-
+
Regel ontbreekt het verwachte scheidingsteken (het karakter: {0}).
-
+
De locatie heeft een incorrect aantal kolommen.
\ No newline at end of file
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/CharacteristicPointsCsvReader.cs
===================================================================
diff -u -rfea3332b5f7a5cea6b41de4a6368c1f1c2bf1282 -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision fea3332b5f7a5cea6b41de4a6368c1f1c2bf1282)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SurfaceLines/CharacteristicPointsCsvReader.cs (.../CharacteristicPointsCsvReader.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -225,7 +225,7 @@
{
if (!IsHeaderValid(header))
{
- throw CreateCriticalFileReadException(currentLine, Resources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ throw CreateCriticalFileReadException(currentLine, Resources.CharacteristicPointsCsvReader_File_invalid_header);
}
}
else
@@ -381,7 +381,7 @@
string locationName = GetLocationName(tokenizedString);
if (tokenizedString.Length != columnsInFile.Count)
{
- throw CreateLineParseException(lineNumber, locationName, Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
+ throw CreateLineParseException(lineNumber, locationName, Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
}
var location = new CharacteristicPoints(locationName);
@@ -487,7 +487,7 @@
{
if (!readText.Contains(separator))
{
- throw CreateLineParseException(lineNumber, string.Format(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_,
+ throw CreateLineParseException(lineNumber, string.Format(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_,
separator));
}
return readText.Split(separator)
@@ -535,7 +535,7 @@
private LineParseException CreateLineParseException(int currentLine, string locationName, string lineParseErrorMessage, Exception innerException = null)
{
string locationDescription = string.Format(Resources.TextFile_On_LineNumber_0_, currentLine);
- string subjectDescription = string.Format(Resources.PipingCharacteristicPointsCsvReader_LocationName_0_, locationName);
+ string subjectDescription = string.Format(Resources.CharacteristicPointsCsvReader_LocationName_0_, locationName);
var message = new FileReaderErrorMessageBuilder(filePath).WithLocation(locationDescription)
.WithSubject(subjectDescription)
.Build(lineParseErrorMessage);
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs
===================================================================
diff -u -r925d8a1d7dec6ef95d89b2ff67d78c8d5a49387f -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision 925d8a1d7dec6ef95d89b2ff67d78c8d5a49387f)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/FileImporter/PipingSurfaceLinesCsvImporter.cs (.../PipingSurfaceLinesCsvImporter.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -374,42 +374,19 @@
readSurfaceLine.Name,
RingtoetsPluginResources.CharacteristicPoint_DitchDikeSide);
- TrySetLForPoint(characteristicPointsLocation.DikeToeAtRiver,
- readSurfaceLine,
- l => readSurfaceLine.EntryPointL = l,
+ TrySetCharacteristicPoint(
+ characteristicPointsLocation.DikeToeAtRiver,
+ readSurfaceLine.SetEntryPointAt,
+ readSurfaceLine.Name,
RingtoetsPluginResources.CharacteristicPoint_DikeToeAtRiver);
- TrySetLForPoint(characteristicPointsLocation.DikeToeAtPolder,
- readSurfaceLine,
- l => readSurfaceLine.ExitPointL = l,
+ TrySetCharacteristicPoint(
+ characteristicPointsLocation.DikeToeAtPolder,
+ readSurfaceLine.SetExitPointAt,
+ readSurfaceLine.Name,
RingtoetsPluginResources.CharacteristicPoint_DikeToeAtPolder);
}
- private void TrySetLForPoint(Point3D point, RingtoetsPipingSurfaceLine readSurfaceLine, Action setAction, string characteristicPointType)
- {
- if (IsDefined(point))
- {
- var index = readSurfaceLine.Points.ToList().IndexOf(point);
- if (index < 0)
- {
- var message = string.Format(PipingDataResources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
- point.X,
- point.Y,
- point.Z);
-
- log.ErrorFormat(RingtoetsPluginResources.PipingSurfaceLinesCsvImporter_CharacteristicPoint_0_of_SurfaceLine_1_skipped_cause_2_,
- characteristicPointType,
- readSurfaceLine.Name,
- message);
- }
- else
- {
- var localPoint = readSurfaceLine.ProjectGeometryToLZ().ElementAt(index);
- setAction(localPoint.X);
- }
- }
- }
-
private void TrySetCharacteristicPoint(Point3D point, Action setAction, string surfaceLineName, string characteristicPointType)
{
if (IsDefined(point))
Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs
===================================================================
diff -u -r0fbc8f9fa6f5b5d0f25359a944cf94cb0d9583fd -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision 0fbc8f9fa6f5b5d0f25359a944cf94cb0d9583fd)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/RingtoetsPipingSurfaceLineTest.cs (.../RingtoetsPipingSurfaceLineTest.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Runtime.Remoting;
using Core.Common.Base.Geometry;
using Core.Common.TestUtil;
using NUnit.Framework;
using Ringtoets.Piping.Data.Exceptions;
+using Ringtoets.Piping.Data.Properties;
namespace Ringtoets.Piping.Data.Test
{
@@ -318,6 +318,44 @@
}
[Test]
+ public void SetDitchPolderSideAt_GeometryEmpty_ThrowsInvalidOperationException()
+ {
+ // Setup
+ var random = new Random(21);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+ var z = random.NextDouble();
+ Point3D testPoint = new Point3D
+ {
+ X = x,
+ Y = y,
+ Z = z
+ };
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetDitchPolderSideAt(testPoint);
+
+ // Assert
+ var message = string.Format(Resources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
+ x,y,z);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
+ }
+
+ [Test]
+ public void SetDitchPolderSideAt_Null_ThrowsArgumentNullException()
+ {
+ // Setup
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetDitchPolderSideAt(null);
+
+ // Assert
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Cannot find a point in geometry using a null point.");
+ }
+
+ [Test]
public void SetBottomDitchPolderSideAt_PointInGeometry_PointSetFromGeometry()
{
// Setup
@@ -342,6 +380,44 @@
}
[Test]
+ public void SetBottomDitchPolderSideAt_GeometryEmpty_ThrowsInvalidOperationException()
+ {
+ // Setup
+ var random = new Random(21);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+ var z = random.NextDouble();
+ Point3D testPoint = new Point3D
+ {
+ X = x,
+ Y = y,
+ Z = z
+ };
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetBottomDitchPolderSideAt(testPoint);
+
+ // Assert
+ var message = string.Format(Resources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
+ x, y, z);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
+ }
+
+ [Test]
+ public void SetBottomDitchPolderSideAt_Null_ThrowsArgumentNullException()
+ {
+ // Setup
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetBottomDitchPolderSideAt(null);
+
+ // Assert
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Cannot find a point in geometry using a null point.");
+ }
+
+ [Test]
public void SetBottomDitchDikeSideAt_PointInGeometry_PointSetFromGeometry()
{
// Setup
@@ -366,6 +442,44 @@
}
[Test]
+ public void SetBottomDitchDikeSideAt_GeometryEmpty_ThrowsInvalidOperationException()
+ {
+ // Setup
+ var random = new Random(21);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+ var z = random.NextDouble();
+ Point3D testPoint = new Point3D
+ {
+ X = x,
+ Y = y,
+ Z = z
+ };
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetBottomDitchDikeSideAt(testPoint);
+
+ // Assert
+ var message = string.Format(Resources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
+ x, y, z);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
+ }
+
+ [Test]
+ public void SetBottomDitchDikeSideAt_Null_ThrowsArgumentNullException()
+ {
+ // Setup
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetBottomDitchDikeSideAt(null);
+
+ // Assert
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Cannot find a point in geometry using a null point.");
+ }
+
+ [Test]
public void SetDitchDikeSideAt_PointInGeometry_PointSetFromGeometry()
{
// Setup
@@ -390,150 +504,165 @@
}
[Test]
- [TestCase(0.0)]
- [TestCase(3.0)]
- [TestCase(4.0)]
- public void EntryPointL_WithinGeometryRange_ValueSet(double testL)
+ public void SetDitchDikeSideAt_GeometryEmpty_ThrowsInvalidOperationException()
{
// Setup
- var surfaceLine = new RingtoetsPipingSurfaceLine();
- surfaceLine.SetGeometry(new[]
+ var random = new Random(21);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+ var z = random.NextDouble();
+ Point3D testPoint = new Point3D
{
- new Point3D
- {
- X = 1.0, Y = 0.0, Z = 0.0
- },
- new Point3D
- {
- X = 5.0, Y = 0.0, Z = 0.0
- }
- });
+ X = x,
+ Y = y,
+ Z = z
+ };
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
// Call
- surfaceLine.EntryPointL = testL;
+ TestDelegate test = () => surfaceLine.SetDitchDikeSideAt(testPoint);
// Assert
- Assert.AreEqual(testL, surfaceLine.EntryPointL);
+ var message = string.Format(Resources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
+ x, y, z);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
}
[Test]
- [TestCase(-1.0)]
- [TestCase(-1e-6)]
- [TestCase(4.1 + 1e-6)]
- [TestCase(5.0)]
- public void EntryPointL_OutsideGeometryRange_ThrowsArgumentOutOfRangeException(double testL)
+ public void SetDitchDikeSideAt_Null_ThrowsArgumentNullException()
{
// Setup
var surfaceLine = new RingtoetsPipingSurfaceLine();
- var min = 1.0;
- var max = 5.1;
- surfaceLine.SetGeometry(new[]
+
+ // Call
+ TestDelegate test = () => surfaceLine.SetDitchDikeSideAt(null);
+
+ // Assert
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Cannot find a point in geometry using a null point.");
+ }
+
+ [Test]
+ public void SetEntryPointAt_PointInGeometry_PointSetFromGeometry()
+ {
+ // Setup
+ var testX = 1.0;
+ var testY = 2.2;
+ var testZ = 4.4;
+ Point3D testPoint = new Point3D
{
- new Point3D
- {
- X = min, Y = 0.0, Z = 0.0
- },
- new Point3D
- {
- X = max, Y = 0.0, Z = 0.0
- }
- });
+ X = testX,
+ Y = testY,
+ Z = testZ
+ };
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
+ CreateTestGeometry(testPoint, surfaceLine);
// Call
- TestDelegate test = () => surfaceLine.EntryPointL = testL;
+ surfaceLine.SetEntryPointAt(testPoint);
// Assert
- var expectedMessage = string.Format("Kan intredepunt niet zetten. L moet in het bereik van [{0}, {1}] liggen.",
- 0, 4.1);
- TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage);
+ Assert.AreEqual(testPoint, surfaceLine.EntryPoint);
+ Assert.AreNotSame(testPoint, surfaceLine.EntryPoint);
}
[Test]
- public void EntryPointL_EmptyGeometry_ThrowsInvalidOperationException()
+ public void SetEntryPointAt_GeometryEmpty_ThrowsInvalidOperationException()
{
// Setup
+ var random = new Random(21);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+ var z = random.NextDouble();
+ Point3D testPoint = new Point3D
+ {
+ X = x,
+ Y = y,
+ Z = z
+ };
var surfaceLine = new RingtoetsPipingSurfaceLine();
// Call
- TestDelegate test = () => surfaceLine.EntryPointL = new Random(21).NextDouble();
+ TestDelegate test = () => surfaceLine.SetEntryPointAt(testPoint);
// Assert
- var expectedMessage = "De profielmeting heeft geen geometrie.";
- var message = Assert.Throws(test).Message;
- Assert.AreEqual(expectedMessage, message);
+ var message = string.Format(Resources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
+ x, y, z);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
}
[Test]
- [TestCase(0.0)]
- [TestCase(3.0)]
- [TestCase(4.0)]
- public void ExitPointL_WithinGeometryRange_ValueSet(double testL)
+ public void SetEntryPointAt_Null_ThrowsArgumentNullException()
{
// Setup
var surfaceLine = new RingtoetsPipingSurfaceLine();
- surfaceLine.SetGeometry(new[]
- {
- new Point3D
- {
- X = 1.0, Y = 0.0, Z = 0.0
- },
- new Point3D
- {
- X = 5.0, Y = 0.0, Z = 0.0
- }
- });
// Call
- surfaceLine.ExitPointL = testL;
+ TestDelegate test = () => surfaceLine.SetEntryPointAt(null);
// Assert
- Assert.AreEqual(testL, surfaceLine.ExitPointL);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Cannot find a point in geometry using a null point.");
}
+
[Test]
- [TestCase(-1.0)]
- [TestCase(-1e-6)]
- [TestCase(4.1 + 1e-6)]
- [TestCase(5.0)]
- public void ExitPointL_OutsideGeometryRange_ThrowsArgumentOutOfRangeException(double testL)
+ public void SetExitPointAt_PointInGeometry_PointSetFromGeometry()
{
// Setup
+ var testX = 1.0;
+ var testY = 2.2;
+ var testZ = 4.4;
+ Point3D testPoint = new Point3D
+ {
+ X = testX,
+ Y = testY,
+ Z = testZ
+ };
var surfaceLine = new RingtoetsPipingSurfaceLine();
- var min = 1.0;
- var max = 5.1;
- surfaceLine.SetGeometry(new[]
+ CreateTestGeometry(testPoint, surfaceLine);
+
+ // Call
+ surfaceLine.SetExitPointAt(testPoint);
+
+ // Assert
+ Assert.AreEqual(testPoint, surfaceLine.ExitPoint);
+ Assert.AreNotSame(testPoint, surfaceLine.ExitPoint);
+ }
+
+ [Test]
+ public void SetExitPointAt_GeometryEmpty_ThrowsInvalidOperationException()
+ {
+ // Setup
+ var random = new Random(21);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+ var z = random.NextDouble();
+ Point3D testPoint = new Point3D
{
- new Point3D
- {
- X = min, Y = 0.0, Z = 0.0
- },
- new Point3D
- {
- X = max, Y = 0.0, Z = 0.0
- }
- });
+ X = x,
+ Y = y,
+ Z = z
+ };
+ var surfaceLine = new RingtoetsPipingSurfaceLine();
// Call
- TestDelegate test = () => surfaceLine.ExitPointL = testL;
+ TestDelegate test = () => surfaceLine.SetExitPointAt(testPoint);
// Assert
- var expectedMessage = string.Format("Kan uittredepunt niet zetten. L moet in het bereik van [{0}, {1}] liggen.",
- 0, 4.1);
- TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage);
+ var message = string.Format(Resources.RingtoetsPipingSurfaceLine_SetCharacteristicPointAt_Geometry_does_not_contain_point_at_0_1_2_to_assign_as_characteristic_point,
+ x, y, z);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, message);
}
[Test]
- public void ExitPointL_EmptyGeometry_ThrowsInvalidOperationException()
+ public void SetExitPointAt_Null_ThrowsArgumentNullException()
{
// Setup
var surfaceLine = new RingtoetsPipingSurfaceLine();
// Call
- TestDelegate test = () => surfaceLine.ExitPointL = new Random(21).NextDouble();
+ TestDelegate test = () => surfaceLine.SetExitPointAt(null);
// Assert
- var expectedMessage = "De profielmeting heeft geen geometrie.";
- var message = Assert.Throws(test).Message;
- Assert.AreEqual(expectedMessage, message);
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, "Cannot find a point in geometry using a null point.");
}
private static void CreateTestGeometry(Point3D testPoint, RingtoetsPipingSurfaceLine surfaceLine)
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/RingtoetsPipingSurfaceLinePropertiesTest.cs
===================================================================
diff -u -r5fc981700e34ae08fff93a9a2207e2edde02213b -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/RingtoetsPipingSurfaceLinePropertiesTest.cs (.../RingtoetsPipingSurfaceLinePropertiesTest.cs) (revision 5fc981700e34ae08fff93a9a2207e2edde02213b)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/RingtoetsPipingSurfaceLinePropertiesTest.cs (.../RingtoetsPipingSurfaceLinePropertiesTest.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -32,8 +32,6 @@
// Setup
const string expectedName = "";
var random = new Random(21);
- double expectedEntryPointL = random.NextDouble();
- double expectedExitPointL = random.NextDouble();
var point1 = new Point3D
{
X = 1.1, Y = 2.2, Z = 3.3
@@ -52,8 +50,8 @@
point1,
point2
});
- surfaceLine.EntryPointL = expectedEntryPointL;
- surfaceLine.ExitPointL = expectedExitPointL;
+ surfaceLine.SetEntryPointAt(point1);
+ surfaceLine.SetExitPointAt(point2);
surfaceLine.SetDitchDikeSideAt(point1);
surfaceLine.SetBottomDitchDikeSideAt(point1);
surfaceLine.SetBottomDitchPolderSideAt(point2);
@@ -67,8 +65,8 @@
// Call & Assert
Assert.AreEqual(expectedName, properties.Name);
CollectionAssert.AreEqual(surfaceLine.Points, properties.Points);
- Assert.AreEqual(expectedEntryPointL, properties.EntryPointL);
- Assert.AreEqual(expectedExitPointL, properties.ExitPointL);
+ Assert.AreEqual(point1, properties.EntryPoint);
+ Assert.AreEqual(point2, properties.ExitPoint);
Assert.AreEqual(point1, properties.DitchDikeSide);
Assert.AreEqual(point1, properties.BottomDitchDikeSide);
Assert.AreEqual(point2, properties.BottomDitchPolderSide);
Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs
===================================================================
diff -u -r68597fa1a4f4d31ee209873eec139f9412026bd2 -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision 68597fa1a4f4d31ee209873eec139f9412026bd2)
+++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SurfaceLines/CharacteristicPointsCsvReaderTest.cs (.../CharacteristicPointsCsvReaderTest.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -181,7 +181,7 @@
// Assert
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.CharacteristicPointsCsvReader_File_invalid_header);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -202,7 +202,7 @@
// Assert
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.CharacteristicPointsCsvReader_File_invalid_header);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -223,7 +223,7 @@
// Assert
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.CharacteristicPointsCsvReader_File_invalid_header);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -354,7 +354,7 @@
// Assert
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.CharacteristicPointsCsvReader_File_invalid_header);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -375,7 +375,7 @@
// Assert
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 1").Build(Resources.CharacteristicPointsCsvReader_File_invalid_header);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -453,11 +453,11 @@
// Assert
// 1st line has no text at all:
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 2").Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 2").Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
Assert.AreEqual(expectedMessage, exception.Message);
// 2nd line has only whitespace text:
- expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 3").Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
+ expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 3").Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
exception = Assert.Throws(call);
Assert.AreEqual(expectedMessage, exception.Message);
}
@@ -480,11 +480,11 @@
// Assert
// 1st line has no text at all:
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 2").Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 2").Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
Assert.AreEqual(expectedMessage, exception.Message);
// 2nd line has only whitespace text:
- expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 4").Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
+ expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 4").Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_ID);
exception = Assert.Throws(call);
Assert.AreEqual(expectedMessage, exception.Message);
}
@@ -506,7 +506,7 @@
// Assert
var exception = Assert.Throws(call);
- var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 0").Build(string.Format(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_, ';'));
+ var expectedMessage = new FileReaderErrorMessageBuilder(path).WithLocation("op regel 0").Build(string.Format(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Line_lacks_separator_0_, ';'));
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -531,15 +531,15 @@
var expectedMessage = new FileReaderErrorMessageBuilder(path)
.WithLocation("op regel 2")
.WithSubject("locatie 'LacksOneCoordinate'")
- .Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
+ .Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
Assert.AreEqual(expectedMessage, exception.Message);
// 2nd row lacks 2 coordinate values:
exception = Assert.Throws(call);
expectedMessage = new FileReaderErrorMessageBuilder(path)
.WithLocation("op regel 3")
.WithSubject("locatie 'LacksTwoCoordinates'")
- .Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
+ .Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
@@ -564,15 +564,15 @@
var expectedMessage = new FileReaderErrorMessageBuilder(path)
.WithLocation("op regel 2")
.WithSubject("locatie 'OneValueTooMuch'")
- .Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
+ .Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
Assert.AreEqual(expectedMessage, exception.Message);
// 2nd row lacks 2 coordinate values:
exception = Assert.Throws(call);
expectedMessage = new FileReaderErrorMessageBuilder(path)
.WithLocation("op regel 3")
.WithSubject("locatie 'ThreeValuesTooMuch'")
- .Build(Resources.PipingCharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
+ .Build(Resources.CharacteristicPointsCsvReader_ReadCharacteristicPointsLocation_Location_lacks_values_for_characteristic_points);
Assert.AreEqual(expectedMessage, exception.Message);
}
}
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLineCsvImporterTest.cs
===================================================================
diff -u -r1abce3b7d9611e826388ff49f3faf8cb1040f80c -re5e9b60b2f5badab0a2b54a4c8542baf124751ce
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLineCsvImporterTest.cs (.../PipingSurfaceLineCsvImporterTest.cs) (revision 1abce3b7d9611e826388ff49f3faf8cb1040f80c)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLineCsvImporterTest.cs (.../PipingSurfaceLineCsvImporterTest.cs) (revision e5e9b60b2f5badab0a2b54a4c8542baf124751ce)
@@ -666,7 +666,7 @@
// Assert
var internalErrorMessage = new FileReaderErrorMessageBuilder(corruptPath)
.WithLocation("op regel 1")
- .Build(PipingIOResources.PipingCharacteristicPointsCsvReader_File_invalid_header);
+ .Build(PipingIOResources.CharacteristicPointsCsvReader_File_invalid_header);
var expectedLogMessages = new[]
{
@@ -1064,10 +1064,19 @@
Y = 427858.191234,
Z = 1.45
}, firstSurfaceLine.DitchDikeSide);
+ Assert.AreEqual(new Point3D
+ {
+ X = 94284.0663827,
+ Y = 427831.918156,
+ Z = 1.25
+ }, firstSurfaceLine.EntryPoint);
+ Assert.AreEqual(new Point3D
+ {
+ X = 94305.3566362,
+ Y = 427889.900123,
+ Z = 1.65
+ }, firstSurfaceLine.ExitPoint);
- Assert.AreEqual(firstSurfaceLine.ProjectGeometryToLZ().ElementAt(2).X, firstSurfaceLine.EntryPointL, double.Epsilon);
- Assert.AreEqual(firstSurfaceLine.ProjectGeometryToLZ().ElementAt(4).X, firstSurfaceLine.ExitPointL, double.Epsilon);
-
var secondSurfaceLine = importTargetArray[1];
Assert.AreEqual("ArtifcialLocal", secondSurfaceLine.Name);
Assert.AreEqual(3, secondSurfaceLine.Points.Count());
@@ -1096,10 +1105,19 @@
Y = 0,
Z = 1.1
}, secondSurfaceLine.DitchDikeSide);
+ Assert.AreEqual(new Point3D
+ {
+ X = 2.3,
+ Y = 0,
+ Z = 1.0
+ }, secondSurfaceLine.EntryPoint);
+ Assert.AreEqual(new Point3D
+ {
+ X = 5.7,
+ Y = 0,
+ Z = 1.1
+ }, secondSurfaceLine.ExitPoint);
- Assert.AreEqual(secondSurfaceLine.ProjectGeometryToLZ().ElementAt(0).X, secondSurfaceLine.EntryPointL, double.Epsilon);
- Assert.AreEqual(secondSurfaceLine.ProjectGeometryToLZ().ElementAt(2).X, secondSurfaceLine.ExitPointL, double.Epsilon);
-
Assert.AreEqual(7, callCount);
Assert.IsTrue(TestHelper.CanOpenFileForWrite(validSurfaceLinesFilePath));