Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLineTest.cs =================================================================== diff -u -r4047 -r4070 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLineTest.cs (.../PLLineTest.cs) (revision 4047) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/PLLineTest.cs (.../PLLineTest.cs) (revision 4070) @@ -19,34 +19,31 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; using System.Linq; +using Deltares.Dam.Data; using Deltares.Geometry; +using NUnit.Framework; namespace Deltares.Dam.Tests { - using NUnit.Framework; - using Deltares.Dam.Data; - [TestFixture] public class PLLineTest { [SetUp] - public void TestFixtureSetup() - { - } + public void TestFixtureSetup() {} [SetUp] - public void TestSetup() - { - } + public void TestSetup() {} [Test] public void TestCreate() { - PLLine plLine = new PLLine(); + var plLine = new PLLine(); Assert.IsNotNull(plLine); } + [Test] public void TestPointEqualsWithTolerance() { @@ -60,14 +57,38 @@ public void GetPointSegmentBetweenReturnsCorrectPoints() { var surfaceLine = new PLLine(); - surfaceLine.Points.Add(new PLLinePoint() { X = 0.4, Z = 0.9 }); - surfaceLine.Points.Add(new PLLinePoint() { X = 1, Z = 1 }); - surfaceLine.Points.Add(new PLLinePoint() { X = 2, Z = 3 }); - surfaceLine.Points.Add(new PLLinePoint() { X = 4, Z = 5 }); - surfaceLine.Points.Add(new PLLinePoint() { X = 10, Z = 12 }); - surfaceLine.Points.Add(new PLLinePoint() { X = 13, Z = 13 }); + surfaceLine.Points.Add(new PLLinePoint + { + X = 0.4, + Z = 0.9 + }); + surfaceLine.Points.Add(new PLLinePoint + { + X = 1, + Z = 1 + }); + surfaceLine.Points.Add(new PLLinePoint + { + X = 2, + Z = 3 + }); + surfaceLine.Points.Add(new PLLinePoint + { + X = 4, + Z = 5 + }); + surfaceLine.Points.Add(new PLLinePoint + { + X = 10, + Z = 12 + }); + surfaceLine.Points.Add(new PLLinePoint + { + X = 13, + Z = 13 + }); - var result = surfaceLine.GetPointSegmentBetween(0.4, 13); + IEnumerable result = surfaceLine.GetPointSegmentBetween(0.4, 13); Assert.AreEqual(4, result.Count()); result = surfaceLine.GetPointSegmentBetween(0.6, 11); @@ -84,8 +105,16 @@ public void TestPositionXzOfPointRelatedToPLLine() { var plLine = new PLLine(); - plLine.Points.Add(new PLLinePoint() { X = 0.0, Z = 0.0 }); - plLine.Points.Add(new PLLinePoint() { X = 10, Z = 0.0 }); + plLine.Points.Add(new PLLinePoint + { + X = 0.0, + Z = 0.0 + }); + plLine.Points.Add(new PLLinePoint + { + X = 10, + Z = 0.0 + }); var pointAbove = new GeometryPoint(1, 0, 1); Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointAbove) == PLLinePointPositionXzType.AbovePLLine); @@ -106,4 +135,4 @@ Assert.IsTrue(plLine.PositionXzOfPointRelatedToPLLine(pointOnBeyond) == PLLinePointPositionXzType.BeyondPLLine); } } -} +} \ No newline at end of file