public void GetTailOfEmptyList_ThrowsInvalidOperationException() { DLList <T> list = new DLList <T>(); T sampleValue = CreateSampleValue(); list.GetTail(sampleValue); }
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); }
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); }