public class SimpleShapeCheckerTest
{
private List<IntPoint> rectangledTriangle = new List<IntPoint>();
public SimpleShapeCheckerTest()
{
longThinRectangle.Add(new IntPoint(0, 0)); //corner
longThinRectangle.Add(new IntPoint(20, 0));
longThinRectangle.Add(new IntPoint(40, 0));
longThinRectangle.Add(new IntPoint(50, 0)); //corner
longThinRectangle.Add(new IntPoint(50, 100));
longThinRectangle.Add(new IntPoint(50, 500));
longThinRectangle.Add(new IntPoint(50, 1000)); // corner
longThinRectangle.Add(new IntPoint(25, 1000));
longThinRectangle.Add(new IntPoint(0, 1000));
longThinRectangle.Add(new IntPoint(0, 500));
}
[TestMethod]
public void IsConvexPolygon()
{
List<IntPoint> corners;
Assert.AreEqual(true, shapeChecker.IsConvexPolygon(rectangle, out corners));
Assert.AreEqual(4, corners.Count);
}