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