public void InsertFirst_Should_Insert_Item_At_First() { var simpleLinkedList = new SimpleLinkedList <int>(1); var secondLinkedList = simpleLinkedList.InsertLast(2); simpleLinkedList.InsertLast(3); var list = simpleLinkedList.ToList(); Assert.Collection(list, i => Assert.Equal(1, i), i => Assert.Equal(2, i), i => Assert.Equal(3, i)); }
private SimpleLinkedList <T> CreateSystemUnderTest <T>(params T[] input) { if (input == null) { return(null); } var simpleLinkedList = new SimpleLinkedList <T>(input[0]); for (var i = 1; i < input.Length; i++) { simpleLinkedList.InsertLast(input[i]); } return(simpleLinkedList); }