public void Get()
        {
            var configuration = new TestIntegerListConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerListProperty", "2,3"));

            CollectionAssert.AreEqual(new List <int> {
                2, 3
            }, configuration.IntegerListProperty);
        }
        public void Get()
        {
            var configuration = new TestIntegerListConfiguration(ConfigurationWithSetting("IntegerListProperty", "1,2"));

            CollectionAssert.AreEqual(new List <int> {
                1, 2
            }, configuration.IntegerListProperty);
        }
        public void GetMissing()
        {
            var configuration = new TestIntegerListConfiguration(ConfigurationWithNoSettings);

            Assert.Throws <ConfigurationException>(
                () =>
                { var v = configuration.IntegerListProperty; }
                );
        }
        public void GetUnParseable()
        {
            var configuration = new TestIntegerListConfiguration(ConfigurationWithSetting($"{UK_PREFIX}IntegerListProperty", "not parseable"));

            Assert.Throws <FormatException>(
                () =>
            {
                // FirstOrDefault is required to execute the list, otherwise lazy evaluation kicks in and nothing happens
                var v = configuration.IntegerListProperty.FirstOrDefault();
            }
                );
        }
Ejemplo n.º 5
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 string CONFIG = "3,4";

            var configuration = new TestIntegerListConfiguration(ConfigurationWithSetting("IntegerListProperty", CONFIG));

            var expected = new List <int> {
                3, 4
            };

            CollectionAssert.AreEqual(expected, configuration.IntegerListProperty);
        }
Ejemplo n.º 6
0
        public void GetMissing()
        {
            var configuration = new TestIntegerListConfiguration(ConfigurationWithNoSettings);

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