public void ForEachNodePairTestThreeList() { List <int> resultFirst = new List <int>(); List <int> resultSecond = new List <int>(); threeList.ForEachNodePair(delegate(CircularLinkedListNode <int> a, CircularLinkedListNode <int> b) { Assert.IsNotNull(a); Assert.IsNotNull(b); resultFirst.Add(a.Value); resultSecond.Add(b.Value); }); Assert.AreEqual(3, resultFirst.Count); Assert.AreEqual(3, resultSecond.Count); Assert.AreEqual(2, resultFirst[0]); Assert.AreEqual(3, resultSecond[0]); Assert.AreEqual(3, resultFirst[1]); Assert.AreEqual(4, resultSecond[1]); Assert.AreEqual(4, resultFirst[2]); Assert.AreEqual(2, resultSecond[2]); }
public void ForEachNodePairTestEmptyList() { List <int> resultFirst = new List <int>(); List <int> resultSecond = new List <int>(); emptyList.ForEachNodePair(delegate(CircularLinkedListNode <int> a, CircularLinkedListNode <int> b) { Assert.IsNotNull(a); Assert.IsNotNull(b); resultFirst.Add(a.Value); resultSecond.Add(b.Value); }); Assert.AreEqual(0, resultFirst.Count); Assert.AreEqual(0, resultSecond.Count); }