Esempio n. 1
0
        public void PointShouldBeInPolygon()
        {
            //arrange
            var point = new PointF {
                X = 2, Y = 2
            };

            //act
            var result = GraphicTool.IsPointInPolygon4(polygon, point);

            //assert
            Assert.IsTrue(result);
        }
Esempio n. 2
0
        public void PointShouldBeNotAtPolygonBorder()
        {
            //arrange
            var point = new PointF {
                X = 1, Y = 1
            };

            //act
            var result = GraphicTool.IsPointInPolygon4(polygon, point);

            //assert
            Assert.IsFalse(result);
        }
Esempio n. 3
0
        public IActionResult IsPointInPolygone([FromBody] GraphicData data)
        {
            if (data == null)
            {
                new ArgumentNullException(nameof(data));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var result = GraphicTool.IsPointInPolygon4(data.Polygon, data.Point);

            return(Ok(result));
        }