public void SetsValueCorrectly() { var configurationService = new ConfigurationService(); configurationService.SetValue("myKey", "myValue"); Assert.AreEqual("myValue", configurationService.GetValue<string>("myKey")); }
public void ReturnsExistingValue() { var configurationService = new ConfigurationService(); configurationService.SetValue("myKey", "myValue"); Assert.AreEqual("myValue", configurationService.GetValue<string>("myKey")); }
public void IsInvokedDuringSetValueMethod() { var configurationService = new ConfigurationService(); bool invoked = false; configurationService.ConfigurationChanged += (sender, e) => invoked = true; configurationService.SetValue("key", "value"); Assert.IsTrue(invoked); }
public void ThrowsArgumentExceptionForEmptyKey() { var configurationService = new ConfigurationService(); ExceptionTester.CallMethodAndExpectException<ArgumentException>(() => configurationService.SetValue(string.Empty, "value")); }