Example #1
0
        public void Get()
        {
            // 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 Test CONFIG        = Test.B;
            var        configuration = new TestEnumWithDefaultWithPrefixConfiguration(ConfigurationWithSetting($"{UK_PREFIX}EnumProperty", $"B"));

            Assert.AreEqual(CONFIG, configuration.EnumProperty);
        }
Example #2
0
        public void GetUnParseable()
        {
            var configuration = new TestEnumWithDefaultWithPrefixConfiguration(ConfigurationWithSetting($"{UK_PREFIX}EnumProperty", "not parseable"));

            Assert.Throws <ArgumentException>(
                () =>
                { var v = configuration.EnumProperty; }
                );
        }
Example #3
0
        public void GetMissing()
        {
            var configuration = new TestEnumWithDefaultWithPrefixConfiguration(ConfigurationWithNoSettings);

            Assert.AreEqual(DEFAULT, configuration.EnumProperty);
        }