public void TestMoveAlongVector() { //Arrange Point2D[] actual; Point2D[] expected = { new Point2D(2, 2), new Point2D(3, 2), new Point2D(3, 3), new Point2D(2, 3) }; IVector vector = new GeometryLib.Fakes.StubIVector() { GetVector = () => { return(new double[] { 1, 1 }); }, GetLength = () => { return(2); } }; //Act testPolygon.MoveAlongVector(vector); actual = testPolygon.GetPoints(); //Assert Console.WriteLine("{0}--{1}", actual[0].Print(), expected[0].Print()); Assert.IsTrue(PointListComparator(expected, actual)); }
public void TestErrorMovingAlongVector() { //Arrange IVector vector = new GeometryLib.Fakes.StubIVector() { GetLength = () => { return(3); } }; //Act testPolygon.MoveAlongVector(vector); }
public void TestMovingByVector() { // Arrange: double[] expected = { 15.0, 23.0 }; IVector vector = new GeometryLib.Fakes.StubIVector() { GetVector = () => { return(new double[] { 4, 3 }); } }; // Act: testPoint1.MoveByVector(vector, 1); // Assert: CollectionAssert.AreEqual(expected, (new[] { testPoint1.X, testPoint1.Y })); }