Exemplo n.º 1
0
 def test_intersection_of_two_sets_with_shared_elements_is_a_set_of_the_shared_elements(
     self,
 ):
     set1 = CustomSet([1, 2, 3, 4])
     set2 = CustomSet([3, 2, 5])
     expected = CustomSet([2, 3])
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_contains_shared_elements_only(self):
     set1 = CustomSet([1, 2, 3, 4])
     set2 = CustomSet([3, 2, 5])
     expected = CustomSet([2, 3])
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_of_sets_with_no_shared_elements_is_empty_set(self):
     set1 = CustomSet([1, 2, 3])
     set2 = CustomSet([4, 5, 6])
     expected = CustomSet()
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_of_non_empty_set_and_empty_set_is_empty_set(self):
     set1 = CustomSet([1, 2, 3, 4])
     set2 = CustomSet()
     expected = CustomSet()
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_of_two_empty_sets_is_empty_set(self):
     set1 = CustomSet()
     set2 = CustomSet()
     expected = CustomSet()
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_contains_shared_elements_only(self):
     set1 = CustomSet([1, 2, 3, 4])
     set2 = CustomSet([3, 2, 5])
     expected = CustomSet([2, 3])
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_of_sets_with_no_shared_elements_is_empty_set(self):
     set1 = CustomSet([1, 2, 3])
     set2 = CustomSet([4, 5, 6])
     expected = CustomSet()
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_of_non_empty_set_and_empty_set_is_empty_set(self):
     set1 = CustomSet([1, 2, 3, 4])
     set2 = CustomSet()
     expected = CustomSet()
     self.assertEqual(set1.intersection(set2), expected)
 def test_intersection_of_two_empty_sets_is_empty_set(self):
     set1 = CustomSet()
     set2 = CustomSet()
     expected = CustomSet()
     self.assertEqual(set1.intersection(set2), expected)