public void RemoveLastPoint() { GraphLine line = CreateLineWithThreePoints(); line.RemoveAt(2); Assert.AreEqual(2, line.points.Count); Assert.AreEqual(1, line.lines.Count); Assert.IsTrue(line.lines[0].StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f))); Assert.IsTrue(line.lines[0].EndPoint.IsNearlyEqual(new Vector2D(0.538f, 0.462f))); }
public void RemoveMiddlePoint() { GraphLine line = CreateLineWithThreePoints(); line.RemoveAt(1); Assert.AreEqual(2, line.points.Count); Assert.AreEqual(1, line.lines.Count); Assert.AreEqual(new Vector2D(0.4f, 0.5f), line.points[0]); Assert.AreEqual(new Vector2D(0.8f, 0.4f), line.points[1]); Assert.IsTrue(line.lines[0].StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f))); Assert.IsTrue(line.lines[0].EndPoint.IsNearlyEqual(new Vector2D(0.6143f, 0.519f))); }