public void TestOne() { LinkedListNode testNodeSecond = new LinkedListNode(); testNodeSecond.val = 10; LinkedListNode testNodeThird = new LinkedListNode(); testNodeThird.val = 2; LinkedListNode testNodeFourth = new LinkedListNode(); testNodeFourth.val = 4; LinkedListNode testNodeFifth = new LinkedListNode(); testNodeFifth.val = 5; LinkedListNode testNodeSixth = new LinkedListNode(); testNodeSixth.val = 6; testNodeSecond.Next = testNodeThird; testNodeThird.Next = testNodeFourth; testNodeFourth.Next = testNodeFifth; testNodeFifth.Next = testNodeSixth; testNodeSixth.Next = null; LinkedListNode compare1 = new LinkedListNode() { val = 5, Next = null }; LinkedListNode compare2 = GSLinkedListRemoveEvens.deleteEven(testNodeSecond); Assert.AreEqual(compare1.val, compare2.val); Assert.AreEqual(compare1.Next, compare2.Next); }
public void TestTwo() { LinkedListNode testNodeSecond = new LinkedListNode(); testNodeSecond.val = 13; LinkedListNode testNodeThird = new LinkedListNode(); testNodeThird.val = 3; LinkedListNode testNodeFourth = new LinkedListNode(); testNodeFourth.val = 4; LinkedListNode testNodeFifth = new LinkedListNode(); testNodeFifth.val = 5; LinkedListNode testNodeSixth = new LinkedListNode(); testNodeSixth.val = 6; testNodeSecond.Next = testNodeThird; testNodeThird.Next = testNodeFourth; testNodeFourth.Next = testNodeFifth; testNodeFifth.Next = testNodeSixth; testNodeSixth.Next = null; LinkedListNode compare1 = new LinkedListNode() { val = 13, Next = null }; LinkedListNode compare2 = new LinkedListNode() { val = 3, Next = null }; LinkedListNode compare3 = new LinkedListNode() { val = 5, Next = null }; LinkedListNode result = GSLinkedListRemoveEvens.deleteEven(testNodeSecond); Assert.AreEqual(compare1.val, result.val); Assert.AreEqual(compare2.val, result.Next.val); Assert.AreEqual(compare3.val, result.Next.Next.val); }