public void RemoveSettingThrowsExceptionTest() { const string exceptionMessage = "Cannot remove a setting from this class."; ISettingProvider provider = new StaticSettingProvider(TestVersion, _testSetting); NotImplementedException thrownException = null; try { provider.RemoveSetting(TestVersion); } catch (NotImplementedException nie) { thrownException = nie; } Assert.IsNotNull(thrownException); Assert.AreEqual(exceptionMessage, thrownException.Message); }