Esempio n. 1
0
        public void Setup()
        {
            emptyList = new CircularLinkedList <int>();
            oneList   = new CircularLinkedList <int>(new int[] { 42 });
            twoList   = new CircularLinkedList <int>(new int[] { 37, 51 });
            threeList = new CircularLinkedList <int>();

            // 2 3 4
            threeList.AddLast(3);
            threeList.AddLast(4);
            threeList.AddFirst(2);

            string[] tmpStrings = new string[] { "foo", "bar", "baz" };
            // FIXME workaround for 74953

            List <string> workaround = new List <string>();

            foreach (string s in tmpStrings)
            {
                workaround.Add(s);
            }

            // strings = new CircularLinkedList <string> (tmpStrings);
            stringList = new CircularLinkedList <string>(workaround);
        }
Esempio n. 2
0
        public void FindPositiveTest()
        {
            threeList.AddFirst(4);

            CircularLinkedListNode <int> head, tail;

            head = threeList.Find(4);
            tail = threeList.FindLast(4);
            Assert.AreEqual(threeList.First, head);
            Assert.AreEqual(threeList.Last, tail);
        }