コード例 #1
0
    def test_insert_fist(self, values_to_add, all_values_from_head, all_values_from_tail):
        instance = MyDoubleLinkedList()
        for value in values_to_add:
            instance.insert_first(value)

        assert all_values_from_head == instance.all_values_from_head
        assert all_values_from_tail == instance.all_values_from_tail
コード例 #2
0
 def test_first(self, values_to_add, expected_value, all_values_from_head, all_values_from_tail):
     instance = MyDoubleLinkedList()
     for value in values_to_add:
         instance.insert_first(value)
     actual_result = instance.first
     assert actual_result == expected_value
     assert all_values_from_head == instance.all_values_from_head
     assert all_values_from_tail == instance.all_values_from_tail
コード例 #3
0
    def test_delete_last(self, values_to_add, expected_deleted_value, all_values_from_head, all_values_from_tail):
        instance = MyDoubleLinkedList()
        for value in values_to_add:
            instance.insert_first(value)

        deleted_value = instance.delete_last()
        assert deleted_value == expected_deleted_value
        assert all_values_from_head == instance.all_values_from_head
        assert all_values_from_tail == instance.all_values_from_tail