def test_xOrder_withEqualXCoordinatePoints_shouldReturnZero(self): for i in range(500): x = random.uniform(0, 1000) a = Point2D(x, 1) b = Point2D(x, -1) self.assertEqual(0, Point2D.x_order(a, b)) self.assertEqual(0, Point2D.x_order(b, a))
def test_xOrder_withNotEqualXCoordinatePoints_shouldReturnCorrectComparatorResult(self): for i in range(500): xa = random.uniform(0, 1000) xb = random.uniform(-1000, -1) a = Point2D(xa, 1) b = Point2D(xb, -1) self.assertEqual(1, Point2D.x_order(a, b)) self.assertEqual(-1, Point2D.x_order(b, a))