示例#1
0
        public void GetPointsOnDiagonalLineTests()
        {
            var point1 = CreatePoint(0, 0);
            var point2 = CreatePoint(2, 4);

            var result1 = FillPolygon.GetPointsOnLine(point1, point2);

            CompareArrays(result1, new List <Point>()
            {
                new Point(0, 0),
                new Point(0, 1),
                new Point(1, 2),
                new Point(1, 3),
                new Point(2, 4)
            });

            var result2 = FillPolygon.GetPointsOnLine(point2, point1);

            CompareArrays(result2, new List <Point>()
            {
                new Point(0, 0),
                new Point(0, 1),
                new Point(1, 2),
                new Point(1, 3),
                new Point(2, 4)
            });
        }
示例#2
0
        public void GetPointsOnStraightLineTests()
        {
            var point1 = CreatePoint(1, 1);
            var point2 = CreatePoint(4, 1);

            CompareArrays(FillPolygon.GetPointsOnLine(point1, point2),
                          new List <Point>()
            {
                new Point(1, 1),
                new Point(2, 1),
                new Point(3, 1),
                new Point(4, 1),
            });

            CompareArrays(FillPolygon.GetPointsOnLine(point2, point1),
                          new List <Point>()
            {
                new Point(1, 1),
                new Point(2, 1),
                new Point(3, 1),
                new Point(4, 1),
            });
        }