System.Collections.Tests.IList_NonGeneric_Tests.IList_NonGeneric_IndexOf_ValueInCollectionMultipleTimes C# (CSharp) Метод

IList_NonGeneric_IndexOf_ValueInCollectionMultipleTimes() приватный Метод

private IList_NonGeneric_IndexOf_ValueInCollectionMultipleTimes ( int count ) : void
count int
Результат void
        public void IList_NonGeneric_IndexOf_ValueInCollectionMultipleTimes(int count)
        {
            if (count > 0 && !IsReadOnly && !ExpectedFixedSize && DuplicateValuesAllowed)
            {
                // IndexOf should always return the lowest index for which a matching element is found
                IList list = NonGenericIListFactory(count);
                object value = CreateT(12345);
                list[0] = value;
                list[count / 2] = value;
                Assert.Equal(0, list.IndexOf(value));
            }
        }
IList_NonGeneric_Tests