public void GetBool() { // This test makes sure that if there is a config setting then it is used in place of the default. Make sure that the default value and the config value are different. const int CONFIG = DEFAULT + 1; var configuration = new TestIntegerConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerProperty", $"{CONFIG}")); Assert.AreEqual(CONFIG, configuration.IntegerProperty); }
public void GetUnParseable() { var configuration = new TestIntegerConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerProperty", "not parseable")); Assert.Throws <FormatException>( () => { var v = configuration.IntegerProperty; } ); }
public void GetMissing() { var configuration = new TestIntegerConfiguration(ConfigurationWithNoSettings); Assert.Throws <ConfigurationException>( () => { var v = configuration.IntegerProperty; } ); }
public void GetMissing() { var configuration = new TestIntegerConfiguration(ConfigurationWithNoSettings); Assert.AreEqual(DEFAULT, configuration.IntegerProperty); }
public void Get() { var configuration = new TestIntegerConfiguration(ConfigurationWithSetting("IntegerProperty", "2")); Assert.AreEqual(2, configuration.IntegerProperty); }
public void Get() { var configuration = new TestIntegerConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerProperty", "234")); Assert.AreEqual(234, configuration.IntegerProperty); }