コード例 #1
0
        public void InsertThree_Expect_FindThree()
        {
            var linkedList = new WsDoubleLinkedList();

            linkedList.InsertFirst(2);
            linkedList.InsertFirst(3);

            var valueFound = linkedList.Find(3);

            Assert.NotNull(valueFound);
            Assert.Equal(3, valueFound.Value);
        }
コード例 #2
0
        public void InsertNodeBeforeInMiddle_Expect_ReferencePrevious()
        {
            var linkedList = new WsDoubleLinkedList();

            linkedList.InsertFirst(2);
            linkedList.InsertFirst(3);

            linkedList.InsertBefore(2, 1);

            var nodeInserted = linkedList.Find(1);

            Assert.Equal(3, nodeInserted.Previous.Value);
        }