示例#1
0
        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);
        }
示例#2
0
        public void GetUnParseable()
        {
            var configuration = new TestIntegerConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerProperty", "not parseable"));

            Assert.Throws <FormatException>(
                () =>
                { var v = configuration.IntegerProperty; }
                );
        }
示例#3
0
        public void GetMissing()
        {
            var configuration = new TestIntegerConfiguration(ConfigurationWithNoSettings);

            Assert.Throws <ConfigurationException>(
                () =>
                { var v = configuration.IntegerProperty; }
                );
        }
示例#4
0
        public void GetMissing()
        {
            var configuration = new TestIntegerConfiguration(ConfigurationWithNoSettings);

            Assert.AreEqual(DEFAULT, configuration.IntegerProperty);
        }
示例#5
0
        public void Get()
        {
            var configuration = new TestIntegerConfiguration(ConfigurationWithSetting("IntegerProperty", "2"));

            Assert.AreEqual(2, configuration.IntegerProperty);
        }
示例#6
0
        public void Get()
        {
            var configuration = new TestIntegerConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerProperty", "234"));

            Assert.AreEqual(234, configuration.IntegerProperty);
        }