Пример #1
0
        public void LinkedListShouldContainEmptyHeadNode_WhenANewLinkedListHasBeenMadeWithoutInitialValue()
        {
            // Arrange & Act
            var linkedList = new Library.Datastructures.LinkedList.LinkedList <int>();

            // Assert
            Assert.AreEqual(null, linkedList.Root);
        }
Пример #2
0
        public void LinkedListShouldContainHeadNode_WhenANewLinkedListHasBeenMadeWithInitialValue()
        {
            // Arrange & Act
            var linkedList = new Library.Datastructures.LinkedList.LinkedList <int>(10);

            // Assert
            Assert.IsNotNull(linkedList.Root);
            Assert.AreEqual(10, linkedList.Root.Data);
        }
Пример #3
0
        public void AppendToHeadShouldCreateAndInsertNodeAtHeadPosition_WhenANewValueIsAppendedToHead()
        {
            // Arrange
            var linkedList = new Library.Datastructures.LinkedList.LinkedList <int>();

            // Act
            linkedList.AppendToHead(10);

            // Assert
            Assert.AreEqual(10, linkedList.Root.Data);
        }