public void DistanceToPointTest( float x, float y, float x1, float y1, float x2, float y2, float expectedDistance ) { Point pt = new Point( x, y ); Point pt1 = new Point( x1, y1 ); Point pt2 = new Point( x2, y2 ); LineSegment segment = new LineSegment( pt1, pt2 ); Assert.AreEqual( expectedDistance, segment.DistanceToPoint( pt ) ); }