コード例 #1
0
        public void Polygon_TranslateTest()
        {

            Point point1 = Point.MakePointWithInches(1, -5, -4);
            Point point2 = Point.MakePointWithInches(1, 0, 0);
            Point point3 = Point.Origin;
            Point point4 = Point.MakePointWithInches(0, -5, -4);
            List<Point> vertices = new List<Point>() { point1, point2, point3, point4 };
            Polygon testPolygon = new Polygon(vertices);

            Point testDisplacement = Point.MakePointWithInches(-1, 5, 4);

            Polygon actualPolygon = testPolygon.Translate(testDisplacement);

            Point point5 = Point.Origin;
            Point point6 = Point.MakePointWithInches(0, 5, 4);
            Point point7 = Point.MakePointWithInches(-1, 5, 4);
            Point point8 = Point.MakePointWithInches(-1, 0, 0);
            List<Point> expectedVertices = new List<Point>() { point5, point6, point7, point8 };
            Polygon expectedPolygon = new Polygon(expectedVertices);

            actualPolygon.Should().Be(expectedPolygon);
        }