System.Collections.Tests.IList_NonGeneric_Tests.IList_NonGeneric_Remove_NonNullNotContainedInCollection C# (CSharp) Method

IList_NonGeneric_Remove_NonNullNotContainedInCollection() private method

private IList_NonGeneric_Remove_NonNullNotContainedInCollection ( int count ) : void
count int
return void
        public void IList_NonGeneric_Remove_NonNullNotContainedInCollection(int count)
        {
            if (!IsReadOnly && !ExpectedFixedSize)
            {
                int seed = count * 251;
                IList list = NonGenericIListFactory(count);
                object value = CreateT(seed++);
                while (list.Contains(value) || Enumerable.Contains(InvalidValues, value))
                    value = CreateT(seed++);
                list.Remove(value);

                if (IList_NonGeneric_RemoveNonExistent_Throws)
                {
                    Assert.Throws<ArgumentException>(() => list.Remove(value));
                }
                else
                {
                    Assert.Equal(count, list.Count);
                }
            }
        }
IList_NonGeneric_Tests