예제 #1
0
 public void TestToString()
 {
     Task.BidirectionalList <int> bidirectionalList = new Task.BidirectionalList <int>();
     Debug.Print(bidirectionalList.ToString());
     bidirectionalList.Add(1);
     Debug.Print(bidirectionalList.ToString());
     for (int index = 0; index < 1000; index++)
     {
         bidirectionalList.Add(index);
     }
     Debug.Print(bidirectionalList.ToString());
 }
예제 #2
0
        public void TestRemove()
        {
            Task.BidirectionalList <int> bidirectionalList = new Task.BidirectionalList <int>();
            Random random = new Random();

            bidirectionalList.Add(1);
            bidirectionalList.Remove(0);
            bidirectionalList.Add(1);
            bidirectionalList.Add(1);
            bidirectionalList.Remove(1);
            bidirectionalList.Remove(0);
            for (int index = 0; index < 1000; index++)
            {
                bidirectionalList.Add(random.Next(10000000));
            }
            bidirectionalList.Remove(0);
            bidirectionalList.Remove(1);
            bidirectionalList.Remove(random.Next(998));
            bidirectionalList.Remove(996);
            if (bidirectionalList.Length != 996)
            {
                throw new Exception("Length");
            }
            Debug.Print(bidirectionalList.ToString());
        }
예제 #3
0
        public void TestAddIndex()
        {
            Task.BidirectionalList <int> bidirectionalList = new Task.BidirectionalList <int>();
            Random random = new Random();

            bidirectionalList.Add(0, random.Next(10000000));
            bidirectionalList.Add(0, random.Next(10000000));
            bidirectionalList.Add(2, random.Next(10000000));
            bidirectionalList.Add(random.Next(1, 3), random.Next(10000000));
            if (bidirectionalList.Length != 4)
            {
                throw new Exception("Length");
            }
            Debug.Print(bidirectionalList.ToString());
        }
예제 #4
0
        public void TestAdd()
        {
            Task.BidirectionalList <int> bidirectionalList = new Task.BidirectionalList <int>();
            Random random = new Random();

            for (int index = 0; index < 1000; index++)
            {
                bidirectionalList.Add(random.Next(10000000));
            }
            if (bidirectionalList.Length != 1000)
            {
                throw new Exception("Length");
            }
            Debug.Print(bidirectionalList.ToString());
        }