public void PointInsidePolygon_Smoke_Test()
        {
            var polygon = new Polygon(new List <Line>()
            {
                new Line(new Point(0, 0), new Point(10, 10)),
                new Line(new Point(10, 10), new Point(11, 11)),
                new Line(new Point(11, 11), new Point(0, 10))
            });

            var testPoint = new Point(20, 20);

            Assert.IsFalse(PointInsidePolygon.IsInside(polygon, testPoint));

            testPoint = new Point(5, 5);
            Assert.IsTrue(PointInsidePolygon.IsInside(polygon, testPoint));
        }
Exemple #2
0
        public void PointInsidePolygon_Smoke_Test()
        {
            var polygon = new List <int[]>()
            {
                new int[] { 0, 0 },
                new int[] { 10, 10 },
                new int[] { 11, 11 },
                new int[] { 0, 10 }
            };

            var testPoint = new int[] { 20, 20 };

            Assert.IsFalse(PointInsidePolygon.IsInside(polygon, testPoint));

            testPoint = new int[] { 5, 5 };
            Assert.IsTrue(PointInsidePolygon.IsInside(polygon, testPoint));
        }