def test_hit3(self): s = Sphere() i1 = Intersection(-2, s) i2 = Intersection(-1, s) xs = Intersections([i1, i2]) i = xs.hit() self.assertTrue(i == None)
def test_hit1(self): s = Sphere() i1 = Intersection(1, s) i2 = Intersection(2, s) xs = Intersections([i1, i2]) i = xs.hit() self.assertTrue(i == i1)
def test_hit4(self): s = Sphere() i1 = Intersection(5, s) i2 = Intersection(7, s) i3 = Intersection(-3, s) i4 = Intersection(2, s) xs = Intersections([i1, i2, i3, i4]) i = xs.hit() self.assertTrue(i == i4)