public void IList_NonGeneric_IndexOf_ReturnsFirstMatchingValue(int count)
{
if (!IsReadOnly && !ExpectedFixedSize)
{
IList list = NonGenericIListFactory(count);
object[] arr = new object[count];
list.CopyTo(arr, 0);
foreach (object duplicate in arr) // hard copies list to circumvent enumeration error
list.Add(duplicate);
object[] expected = new object[count * 2];
list.CopyTo(expected, 0);
Assert.All(Enumerable.Range(0, count), (index =>
Assert.Equal(index, list.IndexOf(expected[index]))
));
}
}