public void Test_ExceptionClearListIsReadOnly() { var intList = new ListCollection <int> { 1, 2, 3, 4, 5 }; var readOnly = new ReadOnlyListCollection <int>(intList); var checkGet = Assert.Throws <NotSupportedException>(() => readOnly.Clear()); Assert.Equal("List is readonly!", checkGet.Message); }