Index: packages/repositories.config
===================================================================
diff -u -rb3fa1606efddd3bed496c2844a495ff92347fa44 -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- packages/repositories.config (.../repositories.config) (revision b3fa1606efddd3bed496c2844a495ff92347fa44)
+++ packages/repositories.config (.../repositories.config) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -15,8 +15,11 @@
+
+
+
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingCalculation.cs
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingCalculation.cs (.../PipingCalculation.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingCalculation.cs (.../PipingCalculation.cs) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Linq;
using Deltares.WTIPiping;
@@ -55,7 +56,7 @@
public List Validate()
{
List upliftCalculatorValidationResults = input.SurfaceLine != null ?
- CreateUpliftCalculator().Validate() :
+ ValidateUpliftCalculator() :
new List(new[]
{
Resources.PipingCalculation_Validate_Lacks_surfaceline_uplift
@@ -66,6 +67,22 @@
return upliftCalculatorValidationResults.Concat(heaveCalculatorValidationResults).Concat(sellmeijerCalculatorValidationResults).ToList();
}
+ private List ValidateUpliftCalculator()
+ {
+ try
+ {
+ EffectiveThicknessCalculator effectiveThicknessCalculator = CalculateEffectiveThickness();
+ return CreateUpliftCalculator(effectiveThicknessCalculator.EffectiveStress).Validate();
+ }
+ catch (Exception exception)
+ {
+ return new List
+ {
+ exception.Message
+ };
+ }
+ }
+
private Sellmeijer2011Calculator CalculateSellmeijer()
{
Sellmeijer2011Calculator sellmeijerCalculator = CreateSellmeijerCalculator();
@@ -104,7 +121,8 @@
private WTIUpliftCalculator CalculateUplift()
{
- WTIUpliftCalculator upliftCalculator = CreateUpliftCalculator();
+ EffectiveThicknessCalculator calculatedEffectiveStressResult = CalculateEffectiveThickness();
+ WTIUpliftCalculator upliftCalculator = CreateUpliftCalculator(calculatedEffectiveStressResult.EffectiveStress);
try
{
@@ -136,15 +154,13 @@
return calculator;
}
- private WTIUpliftCalculator CreateUpliftCalculator()
+ private WTIUpliftCalculator CreateUpliftCalculator(double effectiveStress)
{
- var effectiveStressResult = CalculateEffectiveThickness();
-
var calculator = new WTIUpliftCalculator
{
VolumetricWeightOfWater = input.WaterVolumetricWeight,
ModelFactorUplift = input.UpliftModelFactor,
- EffectiveStress = effectiveStressResult.EffectiveStress,
+ EffectiveStress = effectiveStress,
HRiver = input.AssessmentLevel,
PhiExit = input.PiezometricHeadExit,
RExit = input.DampingFactorExit,
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingSurfaceLineCreator.cs
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingSurfaceLineCreator.cs (.../PipingSurfaceLineCreator.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Piping/PipingSurfaceLineCreator.cs (.../PipingSurfaceLineCreator.cs) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -1,7 +1,11 @@
+using System;
+using System.Collections.Generic;
using System.Linq;
using Deltares.WTIPiping;
+using MathNet.Numerics.LinearAlgebra.Double;
+
using Ringtoets.Piping.Data;
namespace Ringtoets.Piping.Calculation.Piping
@@ -23,9 +27,66 @@
{
Name = line.Name
};
- surfaceLine.Points.AddRange(line.Points.Select(p => new PipingPoint(p.X, p.Y, p.Z)));
+ if (line.Points.Any())
+ {
+ surfaceLine.Points.AddRange(CreatePoints(line));
+ }
return surfaceLine;
}
+
+ private static IEnumerable CreatePoints(RingtoetsPipingSurfaceLine line)
+ {
+ var surfaceLinePoints = line.Points.ToArray();
+ var localCoordinatesX = new double[surfaceLinePoints.Length];
+ localCoordinatesX[0] = 0.0;
+
+ if (surfaceLinePoints.Length > 1)
+ {
+ ProjectPointsAfterFirstOntoSpanningLine(line, localCoordinatesX);
+ }
+
+ for (int i = 0; i < localCoordinatesX.Length; i++)
+ {
+ yield return new PipingPoint(localCoordinatesX[i], 0.0, surfaceLinePoints[i].Z);
+ }
+ }
+
+ ///
+ /// This method defines the 'spanning line' as the 2D vector going from start to end
+ /// of the surface line points. Then all except the first point is projected onto
+ /// this vector. Then the local coordinates are determined by taking the length of
+ /// each vector along the 'spanning line'.
+ ///
+ /// The surface line to be projected, which has more than 1 geometry point.
+ /// The array into which the projected X-coordinate
+ /// values should be stored. It's should be the same as
+ /// the collection-size of 's
+ /// collection.
+ private static void ProjectPointsAfterFirstOntoSpanningLine(RingtoetsPipingSurfaceLine line, double[] localCoordinatesX)
+ {
+ // Determine the vectors from the first coordinate to each other coordinate point
+ // in the XY world coordinate plane:
+ var worldCoordinates = line.Points.Select(p => new Point2D { X = p.X, Y = p.Y }).ToArray();
+ var worldCoordinateVectors = new Vector[worldCoordinates.Length - 1];
+ for (int i = 1; i < worldCoordinates.Length; i++)
+ {
+ worldCoordinateVectors[i - 1] = worldCoordinates[i] - worldCoordinates[0];
+ }
+
+ // Determine the 'spanning line' vector:
+ var spanningVector = worldCoordinateVectors[worldCoordinateVectors.Length - 1];
+ var spanningVectorDotProduct = spanningVector.DotProduct(spanningVector);
+ var length = Math.Sqrt(spanningVectorDotProduct);
+
+ // Project each vector onto the 'spanning vector' to determine it's X coordinate in local coordinates:
+ for (int i = 0; i < worldCoordinateVectors.Length - 1; i++)
+ {
+ var projectOnSpanningVectorFactor = (worldCoordinateVectors[i].DotProduct(spanningVector)) /
+ (spanningVectorDotProduct);
+ localCoordinatesX[i + 1] = projectOnSpanningVectorFactor * length;
+ }
+ localCoordinatesX[localCoordinatesX.Length - 1] = length;
+ }
}
}
\ No newline at end of file
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Ringtoets.Piping.Calculation.csproj
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Ringtoets.Piping.Calculation.csproj (.../Ringtoets.Piping.Calculation.csproj) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/Ringtoets.Piping.Calculation.csproj (.../Ringtoets.Piping.Calculation.csproj) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -39,8 +39,13 @@
..\..\..\..\..\..\lib\Plugins\Wti\Deltares.WTIPiping.dll
+
+ ..\..\..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll
+ True
+
+
@@ -77,6 +82,9 @@
Resources.Designer.cs
+
+
+
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/packages.config
===================================================================
diff -u
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/packages.config (revision 0)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Calculation/packages.config (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/Point2D.cs
===================================================================
diff -u
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/Point2D.cs (revision 0)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/Point2D.cs (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -0,0 +1,78 @@
+using System;
+
+using MathNet.Numerics.LinearAlgebra.Double;
+
+namespace Ringtoets.Piping.Data
+{
+ ///
+ /// Defines a mathematical point in 2D Euclidean space.
+ ///
+ public class Point2D
+ {
+ ///
+ /// Gets or sets the x coordinate.
+ ///
+ public double X { get; set; }
+
+ ///
+ /// Gets or sets the y coordinate.
+ ///
+ public double Y { get; set; }
+
+ ///
+ /// Determines the 2D vector defined by the difference of two .
+ ///
+ /// Head of the vector.
+ /// Tail of the vector.
+ /// A 2D vector.
+ public static Vector operator -(Point2D p1, Point2D p2)
+ {
+ var result = new DenseVector(2);
+ result[0] = p1.X - p2.X;
+ result[1] = p1.Y - p2.Y;
+ return result;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj))
+ {
+ return false;
+ }
+ if (ReferenceEquals(this, obj))
+ {
+ return true;
+ }
+ if (obj.GetType() != GetType())
+ {
+ return false;
+ }
+ return Equals((Point2D)obj);
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ var hashCode = X.GetHashCode();
+ hashCode = (hashCode * 397) ^ Y.GetHashCode();
+ return hashCode;
+ }
+ }
+
+ public override string ToString()
+ {
+ return String.Format("({0}, {1})", X, Y);
+ }
+
+ ///
+ /// Compares the with based on and .
+ ///
+ /// A to compare with.
+ /// True if the coordinates of the matches the coordinate of . False otherwise.
+ protected bool Equals(Point2D other)
+ {
+ return X.Equals(other.X) && Y.Equals(other.Y);
+ }
+ }
+}
\ No newline at end of file
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -36,8 +36,13 @@
bin\Release\Ringtoets.Piping.Data.xml
+
+ ..\..\..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll
+ True
+
+
@@ -48,6 +53,7 @@
+
@@ -79,6 +85,9 @@
Resources.Designer.cs
+
+
+
Index: src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/packages.config
===================================================================
diff -u
--- src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/packages.config (revision 0)
+++ src/Plugins/Ringtoets/Piping/src/Ringtoets.Piping.Data/packages.config (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Piping/PipingSurfaceLineCreatorTest.cs
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Piping/PipingSurfaceLineCreatorTest.cs (.../PipingSurfaceLineCreatorTest.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Calculation.Test/Piping/PipingSurfaceLineCreatorTest.cs (.../PipingSurfaceLineCreatorTest.cs) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -1,4 +1,5 @@
-using System.Linq;
+using System;
+using System.Linq;
using Deltares.WTIPiping;
using NUnit.Framework;
@@ -11,7 +12,7 @@
public class PipingSurfaceLineCreatorTest
{
[Test]
- public void Create_Always_ReturnsSurfaceLineWithASinglePointAtOrigin()
+ public void Create_NormalizedLocalSurfaceLine_ReturnsSurfaceLineWithIdenticalPoints()
{
// Setup
const string name = "Local coordinate surfaceline";
@@ -36,5 +37,116 @@
CollectionAssert.AreEqual(surfaceLine.Points.Select(p => p.Z).ToArray(), actual.Points.Select(p => p.Z).ToArray());
CollectionAssert.AreEqual(Enumerable.Repeat(PipingCharacteristicPointType.None, surfaceLine.Points.Count()), actual.Points.Select(p => p.Type));
}
+
+ [Test]
+ public void Create_LocalSurfaceLineNotNormalized_TranslateAllPointsToMakeFirstCoordinateZeroX()
+ {
+ // Setup
+ const string name = "Local coordinate surfaceline";
+ var surfaceLine = new RingtoetsPipingSurfaceLine
+ {
+ Name = name
+ };
+ const double firstX = 4.6;
+ surfaceLine.SetGeometry(new[]
+ {
+ new Point3D { X = firstX, Y = 0.0, Z = 1.1 },
+ new Point3D { X = 7.8, Y = 0.0, Z = 3.3 },
+ new Point3D { X = 9.9, Y = 0.0, Z = 5.5 }
+ });
+
+ // Call
+ PipingSurfaceLine actual = PipingSurfaceLineCreator.Create(surfaceLine);
+
+ // Assert
+ var expectedCoordinatesX = surfaceLine.Points.Select(p => p.X - firstX).ToArray();
+ Assert.AreEqual(name, actual.Name);
+ CollectionAssert.AreEqual(expectedCoordinatesX, actual.Points.Select(p => p.X).ToArray());
+ CollectionAssert.AreEqual(surfaceLine.Points.Select(p => p.Y).ToArray(), actual.Points.Select(p => p.Y).ToArray());
+ CollectionAssert.AreEqual(surfaceLine.Points.Select(p => p.Z).ToArray(), actual.Points.Select(p => p.Z).ToArray());
+ CollectionAssert.AreEqual(Enumerable.Repeat(PipingCharacteristicPointType.None, surfaceLine.Points.Count()), actual.Points.Select(p => p.Type));
+ }
+
+ [Test]
+ public void Create_GlobalSurfaceLine_ProjectSurfaceLineIntoLZPlaneSpannedByFirstAndLastPoint()
+ {
+ // Setup
+ const string name = "Global coordinate surfaceline";
+ var surfaceLine = new RingtoetsPipingSurfaceLine
+ {
+ Name = name
+ };
+ surfaceLine.SetGeometry(new[]
+ {
+ new Point3D { X = 1.0, Y = 1.0, Z = 2.2 },
+ new Point3D { X = 2.0, Y = 3.0, Z = 4.4 }, // Outlier from line specified by extrema
+ new Point3D { X = 3.0, Y = 4.0, Z = 7.7 },
+ });
+
+ // Call
+ PipingSurfaceLine actual = PipingSurfaceLineCreator.Create(surfaceLine);
+
+ // Assert
+ var length = Math.Sqrt(2 * 2 + 3 * 3);
+ const double secondCoordinateFactor = (2.0 * 1.0 + 3.0 * 2.0) / (2.0 * 2.0 + 3.0 * 3.0);
+ var expectedCoordinatesX = new[]
+ {
+ 0.0,
+ secondCoordinateFactor * length,
+ length
+ };
+ Assert.AreEqual(name, actual.Name);
+ CollectionAssert.AreEqual(expectedCoordinatesX, actual.Points.Select(p => p.X).ToArray());
+ CollectionAssert.AreEqual(Enumerable.Repeat(0, surfaceLine.Points.Count()).ToArray(), actual.Points.Select(p => p.Y).ToArray());
+ CollectionAssert.AreEqual(surfaceLine.Points.Select(p => p.Z).ToArray(), actual.Points.Select(p => p.Z).ToArray());
+ CollectionAssert.AreEqual(Enumerable.Repeat(PipingCharacteristicPointType.None, surfaceLine.Points.Count()), actual.Points.Select(p => p.Type));
+ }
+
+ [Test]
+ public void Create_SurfaceLineWithOnlyOnePoint_CreatePipingSurfaceLineWithOnePoint()
+ {
+ // Setup
+ const string name = "Global coordinate surfaceline";
+ var surfaceLine = new RingtoetsPipingSurfaceLine
+ {
+ Name = name
+ };
+ surfaceLine.SetGeometry(new[]
+ {
+ new Point3D { X = 1.0, Y = 1.0, Z = 2.2 },
+ });
+
+ // Call
+ PipingSurfaceLine actual = PipingSurfaceLineCreator.Create(surfaceLine);
+
+ // Assert
+ var expectedCoordinatesX = new[]
+ {
+ 0.0,
+ };
+ Assert.AreEqual(name, actual.Name);
+ CollectionAssert.AreEqual(expectedCoordinatesX, actual.Points.Select(p => p.X).ToArray());
+ CollectionAssert.AreEqual(Enumerable.Repeat(0, surfaceLine.Points.Count()).ToArray(), actual.Points.Select(p => p.Y).ToArray());
+ CollectionAssert.AreEqual(surfaceLine.Points.Select(p => p.Z).ToArray(), actual.Points.Select(p => p.Z).ToArray());
+ CollectionAssert.AreEqual(Enumerable.Repeat(PipingCharacteristicPointType.None, surfaceLine.Points.Count()), actual.Points.Select(p => p.Type));
+ }
+
+ [Test]
+ public void Create_SurfaceLineWithoutPoints_CreateSurfaceLineWithoutPoints()
+ {
+ // Setup
+ const string name = "Surfaceline without points";
+ var surfaceLine = new RingtoetsPipingSurfaceLine
+ {
+ Name = name
+ };
+
+ // Call
+ PipingSurfaceLine actual = PipingSurfaceLineCreator.Create(surfaceLine);
+
+ // Assert
+ Assert.AreEqual(name, actual.Name);
+ CollectionAssert.IsEmpty(actual.Points);
+ }
}
}
\ No newline at end of file
Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point2DTest.cs
===================================================================
diff -u
--- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point2DTest.cs (revision 0)
+++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point2DTest.cs (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -0,0 +1,186 @@
+using System;
+
+using MathNet.Numerics.LinearAlgebra.Double;
+
+using NUnit.Framework;
+
+namespace Ringtoets.Piping.Data.Test
+{
+ [TestFixture]
+ public class Point2DTest
+ {
+ [Test]
+ public void DefaultConstructor_ExpectedValues()
+ {
+ // Call
+ var point = new Point2D();
+
+ // Assert
+ Assert.AreEqual(0, point.X);
+ Assert.AreEqual(0, point.Y);
+ }
+
+ [Test]
+ public void AutomaticProperties_SetAndGetValuesAgain_ReturnedValueShouldBeSameAsSetValue()
+ {
+ // Setup
+ var point = new Point2D();
+
+ // Call
+ point.X = 1.1;
+ point.Y = 2.2;
+
+ // Assert
+ Assert.AreEqual(1.1, point.X);
+ Assert.AreEqual(2.2, point.Y);
+ }
+
+ [Test]
+ public void Equals_ToItself_ReturnsTrue()
+ {
+ // Setup
+ var point = new Point2D();
+
+ // Call
+ var result = point.Equals(point);
+
+ // Assert
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ [TestCase(0, 0, 0)]
+ [TestCase(1, 2, 3)]
+ [TestCase(3.5, 3.6, 3.7)]
+ public void Equals_OtherWithSameCoordinates_ReturnsTrue(double x, double y, double z)
+ {
+ // Setup
+ var point = new Point2D
+ {
+ X = x,
+ Y = y,
+ };
+ var otherPoint = new Point2D
+ {
+ X = x,
+ Y = y,
+ };
+
+ // Call
+ var result = point.Equals(otherPoint);
+
+ // Assert
+ Assert.IsTrue(result);
+ }
+
+ [Test]
+ [TestCase(1e-8, 0, 0)]
+ [TestCase(0, 1e-8, 0)]
+ public void Equals_CloseToOtherPoint_ReturnsFalse(double deltaX, double deltaY)
+ {
+ // Setup
+ var random = new Random(22);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+
+ var point = new Point2D
+ {
+ X = x,
+ Y = y,
+ };
+ var otherPoint = new Point2D
+ {
+ X = x + deltaX,
+ Y = y + deltaY,
+ };
+
+ // Call
+ var result = point.Equals(otherPoint);
+
+ // Assert
+ Assert.IsFalse(result);
+ }
+
+ [Test]
+ public void GetHashCode_PointsAreEqual_PointsHashesEqual()
+ {
+ // Setup
+ var random = new Random(22);
+ var x = random.NextDouble();
+ var y = random.NextDouble();
+
+ var point = new Point2D
+ {
+ X = x,
+ Y = y,
+ };
+ var otherPoint = new Point2D
+ {
+ X = x,
+ Y = y,
+ };
+
+ // Call
+ var result = point.GetHashCode();
+ var otherResult = otherPoint.GetHashCode();
+
+ // Assert
+ Assert.AreEqual(result, otherResult);
+ }
+
+ [Test]
+ [SetCulture("nl-NL")]
+ public void ToString_HasCoordinatValues_NL_PrintCoordinateValuesInLocalCulture()
+ {
+ DoToString_HasCoordinateValues_PrintCoordinateValuesInLocalCulture();
+ }
+
+ [Test]
+ [SetCulture("en-US")]
+ public void ToString_HasCoordinatValues_EN_PrintCoordinateValuesInLocalCulture()
+ {
+ DoToString_HasCoordinateValues_PrintCoordinateValuesInLocalCulture();
+ }
+
+ [Test]
+ public void SubstractOperation_TwoDifferentPoints_Return2DVector()
+ {
+ // Setup
+ var point1 = new Point2D
+ {
+ X = 3.0,
+ Y = 4.0
+ };
+ var point2 = new Point2D
+ {
+ X = 1.0,
+ Y = 1.0
+ };
+
+ // Call
+ Vector vector = point1 - point2;
+
+ // Assert
+ Assert.AreEqual(2, vector.Count);
+ Assert.AreEqual(point1.X - point2.X, vector[0]);
+ Assert.AreEqual(point1.Y - point2.Y, vector[1]);
+ }
+
+ private static void DoToString_HasCoordinateValues_PrintCoordinateValuesInLocalCulture()
+ {
+ // Setup
+ var point = new Point2D
+ {
+ X = 1.1,
+ Y = 2.2,
+ };
+
+ // Call
+ var stringRepresentation = point.ToString();
+
+ // Assert
+ var expectedText = String.Format("({0}, {1})", point.X, point.Y);
+ Assert.AreEqual(expectedText, stringRepresentation);
+ }
+ }
+}
\ No newline at end of file
Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point3DTest.cs
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point3DTest.cs (.../Point3DTest.cs) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Point3DTest.cs (.../Point3DTest.cs) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -1,8 +1,6 @@
using System;
using NUnit.Framework;
-using Ringtoets.Piping.Data;
-
namespace Ringtoets.Piping.Data.Test
{
[TestFixture]
Index: src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj
===================================================================
diff -u -r300a33d9acf653458b834b296becbf9ae552de8e -rf97b3a53c14de5e1f277fa6e94f3d40d3b81642c
--- src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision 300a33d9acf653458b834b296becbf9ae552de8e)
+++ src/Plugins/Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision f97b3a53c14de5e1f277fa6e94f3d40d3b81642c)
@@ -33,6 +33,10 @@
MinimumRecommendedRules.ruleset
+
+ ..\..\..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll
+ True
+
..\..\..\..\..\..\lib\nunit.framework.dll
@@ -41,13 +45,15 @@
+
+
@@ -72,6 +78,9 @@
Ringtoets.Piping.Data.TestUtil
+
+
+