Beispiel #1
0
    def test_insert_at_begining_on_empty_list(self):
        #arrange
        sll = SLL()

        #act
        sll.insert_at_begining(1)

        #assert
        self.assertEqual(1, sll.head.data)
Beispiel #2
0
    def test_insert_at_begining_on_nonempty_list(self):
        #arrange
        sll = SLL()
        for i in range(3):
            sll.insert(i)

        #act
        sll.insert_at_begining(4)

        #assert
        self.assertEqual(4, sll.head.data)