Пример #1
0
        public void InsertedElementCanBeRetrieved()
        {
            LinkedList list = new LinkedList();

            int testValue = 1;
            list.Add(testValue);

            int lastAddedItem = list.Last();

            Assert.AreEqual(testValue, lastAddedItem);
        }
Пример #2
0
        public void InsertedElementCanBeRetrieved()
        {
            LinkedList list = new LinkedList();

            int testValue = 1;

            list.Add(testValue);

            int lastAddedItem = list.Last();

            Assert.AreEqual(testValue, lastAddedItem);
        }
Пример #3
0
        public void InsertedLowerElementIsNotLast()
        {
            LinkedList list = new LinkedList();

            int testValue        = 5;
            int smallerTestValue = 3;

            list.Add(testValue);
            list.Add(smallerTestValue);

            int lastAddedItem = list.Last();

            Assert.AreEqual(testValue, lastAddedItem);
        }
Пример #4
0
        public void InsertedLowerElementIsNotLast()
        {
            LinkedList list = new LinkedList();

            int testValue = 5;
            int smallerTestValue = 3;

            list.Add(testValue);
            list.Add(smallerTestValue);

            int lastAddedItem = list.Last();

            Assert.AreEqual(testValue, lastAddedItem);
        }
Пример #5
0
        public void LastOneEmptyListThrowsInvalidOperation()
        {
            LinkedList list = new LinkedList();

            Assert.Throws(typeof(InvalidOperationException), () => list.Last());
        }
Пример #6
0
 public void LastOneEmptyListThrowsInvalidOperation()
 {
     LinkedList list = new LinkedList();
     Assert.Throws(typeof(InvalidOperationException), () => list.Last());
 }