Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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))