Esempio n. 1
0
        public void GetTailOfEmptyList_ThrowsInvalidOperationException()
        {
            DLList <T> list        = new DLList <T>();
            T          sampleValue = CreateSampleValue();

            list.GetTail(sampleValue);
        }
Esempio n. 2
0
        public void GetTailOfSingleElementList_ReturnsZeroLengthArray()
        {
            DLList <T> list        = new DLList <T>();
            T          sampleValue = this.CreateSampleValue();

            list.Append(sampleValue);

            T[] tailOfList = list.GetTail(sampleValue);
            int tailLength = tailOfList.Length;

            Assert.AreEqual(0, tailLength);
        }
Esempio n. 3
0
        AppendTwoElements_GetTailOfFirstElementInTwoElementsList_ReturnsArrayWithOneElementSecondInList()
        {
            DLList <T> list          = new DLList <T>();
            T          firsElement   = this.CreateDifferentValue();
            T          secondElement = this.CreateSampleValue();

            list.Append(firsElement);
            list.Append(secondElement);

            T[] resultTail   = list.GetTail(firsElement);
            T[] expectedTail = new T[] { secondElement };

            CollectionAssert.AreEqual(expectedTail, resultTail);
        }