System.Text.RegularExpressions.Tests.GroupCollectionTests.IListOfT_IsReadOnly C# (CSharp) Method

IListOfT_IsReadOnly() private method

private IListOfT_IsReadOnly ( ) : void
return void
        public static void IListOfT_IsReadOnly()
        {
            IList<Group> list = CreateCollection();
            Assert.True(list.IsReadOnly);
            Assert.Throws<NotSupportedException>(() => list.Add(default(Group)));
            Assert.Throws<NotSupportedException>(() => list.Clear());
            Assert.Throws<NotSupportedException>(() => list.Insert(0, default(Group)));
            Assert.Throws<NotSupportedException>(() => list.Remove(default(Group)));
            Assert.Throws<NotSupportedException>(() => list.RemoveAt(0));
            Assert.Throws<NotSupportedException>(() => list[0] = default(Group));
        }