public void ListTestAddAfter(int expectedCount, int[] values) { var list = new DoublyLinkedList <int>(); foreach (var item in values) { if (list.Count > 0) { list.AddAfter(list.Tail, item); } else { list.AddNodeToFront(item); } } Assert.Equal(expectedCount, list.Count); if (expectedCount > 0) { Assert.Equal(list.Head.prev, list.Tail); Assert.Equal(list.Tail.next, list.Head); Assert.NotNull(list.Head); Assert.NotNull(list.Tail); Assert.Equal(values[0], list.Head.data); Assert.Equal(values[values.Length - 1], list.Tail.data); } }