Esempio n. 1
0
	def test_contains2_should_return_false_if_the_figure_to_evaluate_is_a_rectangle_outside_of_the_first_rectangle(self):
		main_rect = Rectangle (0, 0 , 6 , 8)
		other_rect = Rectangle (1 , 3 , 8 , 3)


		self.assertFalse(main_rect.contains2(other_rect))
Esempio n. 2
0
	def test_contains2_should_return_True_if_point_entered_is_inside_of_the_rectangle(self):
		point = Point (0, 4)
		main_rect = Rectangle (0 , 0 , 5 , 12)

		self.assertTrue(main_rect.contains2(point))
Esempio n. 3
0
	def test_contains2_should_return_False_if_point_entered_is_outside_of_the_rectangle(self):
		point = Point (0, -1)
		main_rect = Rectangle (0 , 0 , 4 , 5)

		self.assertFalse(main_rect.contains2(point))
Esempio n. 4
0
	def test_contains2_should_return_true_if_the_figure_to_evaluate_is_a_rectangle_inside_the_first_rectangle(self):
		main_rect = Rectangle (0, 0 , 6 , 8)
		other_rect = Rectangle (1 , 3 , 2 , 3)


		self.assertTrue(main_rect.contains2(other_rect))
Esempio n. 5
0
	def test_return_false_because_the_rectangle_doesnot_contains_a_circle(self):
		rect = Rectangle(0 , 0 , 10 , 15)
		circ = Circle ( 2, 8 , 4)
		new_rectangle = Rectangle(circ.x, circ.y, 2 * circ.r, 2 * circ.r)

		self.assertFalse(rect.contains2(new_rectangle))
Esempio n. 6
0
	def test_rectangle_contains_a_circle_totally(self):
		rect = Rectangle(0 , 0 , 10 , 15)
		circ = Circle ( 2, 3 , 4)
		new_rectangle = Rectangle(circ.x, circ.y, 2 * circ.r, 2 * circ.r)

		self.assertTrue(rect.contains2(new_rectangle))