public void ValueWithNullKey() { var key = new ConfigurationKey <string>("a"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.Throws <ArgumentNullException>(() => configuration.Value <string>(null)); }
public void ValueWithUnknownKey() { var key = new ConfigurationKey <string>("unknown"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.Throws <ArgumentException>(() => configuration.Value(key)); }
public void ValueAsUnsignedLongWithKnownKey() { var value = 10UL; var key = new ConfigurationKey <ulong>("ulong"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }
public void ValueAsUnsignedShortWithKnownKey() { ushort value = 10; var key = new ConfigurationKey <ushort>("ushort"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }
public void ValueAsStringWithKnownKey() { var value = "string"; var key = new ConfigurationKey <string>("string"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }
public void ValueAsIntWithKnownKey() { var value = 10; var key = new ConfigurationKey <int>("int"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }
public void ValueAsDoubleWithKnownKey() { var value = 10.0d; var key = new ConfigurationKey <double>("double"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }
public void ValueAsCharacterWithKnownKey() { var value = 'a'; var key = new ConfigurationKey <char>("char"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }
public void ValueAsBooleanWithKnownKey() { var value = true; var key = new ConfigurationKey <bool>("bool"); var configuration = new ConsulConfiguration( new List <ConfigurationKeyBase> { key }, _subConfiguration); Assert.AreEqual(value, configuration.Value(key)); }