Ejemplo n.º 1
0
        public void RemoveNthFromEnd_False()
        {
            var head  = new ListNode(1);
            var node2 = new ListNode(2);
            var node3 = new ListNode(3);
            var node4 = new ListNode(4);
            var node5 = new ListNode(5);

            head.next  = node2;
            node2.next = node3;
            node3.next = node4;
            node4.next = node5;
            var expectedOutput = "1,2,3,5";

            var output       = _linkedListService.RemoveNthFromEnd(head, 2);
            var actualOutput = _linkedListService.GetListValues(output);

            Assert.Equal(expectedOutput, actualOutput);
        }