public void UpdateSettingWithProperVersionTest() { const string newSetting = "New Setting"; ISettingProvider provider = new StaticSettingProvider(TestVersion, _testSetting); provider.UpdateSetting(TestVersion, newSetting); var updatedSetting = provider.GetLatestSetting(); Assert.AreEqual(newSetting, updatedSetting); }
public void UpdateSettingWithWrongVersionThrowsExceptionTest() { const string newSetting = "New Setting"; var exceptionMessage = $"Cannot update a version not equal to the configured version ({TestVersion})."; ISettingProvider provider = new StaticSettingProvider(TestVersion, _testSetting); ArgumentException thrownException = null; try { provider.UpdateSetting(TestVersion + 1, newSetting); } catch (ArgumentException ae) { thrownException = ae; } Assert.IsNotNull(thrownException); Assert.AreEqual(exceptionMessage, thrownException.Message); }