Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PolyLineTest.cs =================================================================== diff -u -r4539 -r4625 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PolyLineTest.cs (.../PolyLineTest.cs) (revision 4539) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PolyLineTest.cs (.../PolyLineTest.cs) (revision 4625) @@ -102,17 +102,17 @@ { const double cTolerance = 0.0001; PolyLine polyLine = CreateStrictAscendingPolyLine(); - Assert.AreEqual(5.0, polyLine.YFromX(1.0), cTolerance); - Assert.AreEqual(9.0, polyLine.YFromX(4.0), cTolerance); + Assert.That(polyLine.YFromX(1.0), Is.EqualTo(5.0).Within(cTolerance)); + Assert.That(polyLine.YFromX(4.0), Is.EqualTo(9.0).Within(cTolerance)); } [Test] public void CheckIfYFromXEvaluatesCorrectlyWithOutOfBoundsXValues() { const double cTolerance = 0.0001; PolyLine polyLine = CreateStrictAscendingPolyLine(); - Assert.AreEqual(0.0, polyLine.YFromX(-3.0), cTolerance); - Assert.AreEqual(7.0, polyLine.YFromX(10.0), cTolerance); + Assert.That(polyLine.YFromX(-3.0), Is.EqualTo(0.0).Within(cTolerance)); + Assert.That(polyLine.YFromX(10.0), Is.EqualTo(7.0).Within(cTolerance)); } /// @@ -123,8 +123,8 @@ { const double cTolerance = 0.0001; PolyLine polyLine = CreateNotStrictAscendingPolyLine(); - Assert.AreEqual(5.0, polyLine.YFromX(1.0), cTolerance); - Assert.AreEqual(10.0, polyLine.YFromX(3.0), cTolerance); + Assert.That(polyLine.YFromX(1.0), Is.EqualTo(5.0).Within(cTolerance)); + Assert.That(polyLine.YFromX(3.0), Is.EqualTo(10.0).Within(cTolerance)); } /// @@ -148,7 +148,7 @@ polyLine1.Points.Add(polyLine1.Points[0]); int currentLength = polyLine1.Points.Count; polyLine1.DeleteCoinsidingPoints(); - Assert.AreEqual(currentLength - 1, polyLine1.Points.Count); + Assert.That(polyLine1.Points.Count, Is.EqualTo(currentLength - 1)); } /// @@ -176,8 +176,8 @@ }; IList intersectionPoints = polyLine1.IntersectionPointsXzWithLineXz(line); Assert.IsTrue(intersectionPoints.Count == 1); - Assert.AreEqual(1.0, intersectionPoints[0].X, GeometryPoint.Precision); - Assert.AreEqual(-1.0, intersectionPoints[0].Z, GeometryPoint.Precision); + Assert.That(intersectionPoints[0].X, Is.EqualTo(1.0).Within(GeometryPoint.Precision)); + Assert.That(intersectionPoints[0].Z, Is.EqualTo(-1.0).Within(GeometryPoint.Precision)); } [Test] @@ -204,10 +204,10 @@ }; IList intersectionPoints = polyLine1.IntersectionPointsXzWithLineXz(line); Assert.IsTrue(intersectionPoints.Count == 2); - Assert.AreEqual(1.0, intersectionPoints[0].X, GeometryPoint.Precision); - Assert.AreEqual(-1.0, intersectionPoints[0].Z, GeometryPoint.Precision); - Assert.AreEqual(11.0, intersectionPoints[1].X, GeometryPoint.Precision); - Assert.AreEqual(-1.0, intersectionPoints[1].Z, GeometryPoint.Precision); + Assert.That(intersectionPoints[0].X, Is.EqualTo(1.0).Within(GeometryPoint.Precision)); + Assert.That(intersectionPoints[0].Z, Is.EqualTo(-1.0).Within(GeometryPoint.Precision)); + Assert.That(intersectionPoints[1].X, Is.EqualTo(11.0).Within(GeometryPoint.Precision)); + Assert.That(intersectionPoints[1].Z, Is.EqualTo(-1.0).Within(GeometryPoint.Precision)); } private PolyLine CreateStrictAscendingPolyLine()