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