Ejemplo n.º 1
0
        public void TestLastIndexOf()
        {
            IntList list = new IntList();

            for (int j = 0; j < 1000; j++)
            {
                list.Add(j / 2);
            }
            for (int j = 0; j < 1000; j++)
            {
                if (j < 500)
                {
                    Assert.AreEqual(1 + j * 2, list.LastIndexOf(j));
                }
                else
                {
                    Assert.AreEqual(-1, list.IndexOf(j));
                }
            }
        }