Beispiel #1
0
 def setUp(self):
     self.linked_list = LinkedListWithSortedInsert(sorted(["mathilde", "habib"]))
Beispiel #2
0
class TestCTPMI_16_07(unittest.TestCase):

    def setUp(self):
        self.linked_list = LinkedListWithSortedInsert(sorted(["mathilde", "habib"]))

    def test_case_01(self):
        self.linked_list.sorted_insert("maryam")
        self.assertEqual(list(self.linked_list), ['habib', 'maryam', 'mathilde'])

    def test_case_02(self):
        self.linked_list.sorted_insert("maryam")
        self.linked_list.sorted_insert("alex")
        self.assertEqual(list(self.linked_list), ['alex', 'habib', 'maryam', 'mathilde'])

    def test_case_03(self):
        self.linked_list.sorted_insert("maryam")
        self.linked_list.sorted_insert("alex")
        self.linked_list.sorted_insert("nicolas")
        self.assertEqual(list(self.linked_list), ['alex', 'habib', 'maryam', 'mathilde', 'nicolas'])