Ejemplo n.º 1
0
            public void SetsValueCorrectly()
            {
                var configurationService = new ConfigurationService();
 
                configurationService.SetValue("myKey", "myValue");

                Assert.AreEqual("myValue", configurationService.GetValue<string>("myKey"));
            }
Ejemplo n.º 2
0
            public void ReturnsExistingValue()
            {
                var configurationService = new ConfigurationService();

                configurationService.SetValue("myKey", "myValue");

                Assert.AreEqual("myValue", configurationService.GetValue<string>("myKey"));
            }
Ejemplo n.º 3
0
            public void IsInvokedDuringSetValueMethod()
            {
                var configurationService = new ConfigurationService();

                bool invoked = false;
                configurationService.ConfigurationChanged += (sender, e) => invoked = true;

                configurationService.SetValue("key", "value");

                Assert.IsTrue(invoked);
            }
Ejemplo n.º 4
0
            public void ThrowsArgumentExceptionForEmptyKey()
            {
                var configurationService = new ConfigurationService();

                ExceptionTester.CallMethodAndExpectException<ArgumentException>(() => configurationService.SetValue(string.Empty, "value"));
            }