public void TestPopBack()
        {
            var list = new DoubleEndedLinkedList <int>();

            int[] values = { -4, 3, 5, -6, 3, 5, -20, 0 };

            // Push the items from 'values' array to the list
            foreach (int val in values)
            {
                list.PushBack(val);
            }

            // Repeatedly call PopBack until list gets empty
            int i             = values.Length - 1;
            int expected_size = values.Length;

            while (!list.IsEmpty())
            {
                Assert.AreEqual(expected_size--, list.Size);
                Assert.AreEqual(values[i--], list.PopBack());
            }
        }
        public void PopBackThrowsIfCalledOnEmptyList()
        {
            var list = new DoubleEndedLinkedList <int>();

            Assert.Throws <IndexOutOfRangeException>(() => list.PopBack());
        }