Esempio n. 1
0
        public void ForEachNodeTestThreeList()
        {
            List <int> result = new List <int>();

            threeList.ForEachNode(delegate(CircularLinkedListNode <int> a)
            {
                Assert.IsNotNull(a);
                result.Add(a.Value);
            });
            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(2, result[0]);
            Assert.AreEqual(3, result[1]);
            Assert.AreEqual(4, result[2]);
        }
Esempio n. 2
0
        public void ForEachNodeTestEmptyList()
        {
            List <int> result = new List <int>();

            emptyList.ForEachNode(delegate(CircularLinkedListNode <int> a)
            {
                Assert.IsNotNull(a);
                result.Add(a.Value);
            });
            Assert.AreEqual(0, result.Count);
        }