public void PointShouldBeInPolygon() { //arrange var point = new PointF { X = 2, Y = 2 }; //act var result = GraphicTool.IsPointInPolygon4(polygon, point); //assert Assert.IsTrue(result); }
public void PointShouldBeNotAtPolygonBorder() { //arrange var point = new PointF { X = 1, Y = 1 }; //act var result = GraphicTool.IsPointInPolygon4(polygon, point); //assert Assert.IsFalse(result); }
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)); }