public void TestLastIndexOfBasic()
{
//--------------------------------------------------------------------------
// Variable definitions.
//--------------------------------------------------------------------------
ArrayList arrList = null;
int ndx = -1;
//
// Construct array lists.
//
arrList = new ArrayList((ICollection)strHeroes);
//
// [] Obtain last index of "Batman" items.
//
ndx = arrList.LastIndexOf("Batman");
if (ndx != -1)
{
Assert.Equal(0, strHeroes[ndx].CompareTo((string)arrList[ndx]));
}
//
// [] Attempt to find null object.
//
// Remove range of items.
ndx = arrList.LastIndexOf(null);
Assert.Equal(-1, ndx);
// [] Call LastIndexOf on an empty list
var myList = new ArrayList();
var lastIndex = myList.LastIndexOf(6);
Assert.Equal(-1, lastIndex);
}