Esempio n. 1
0
        public void ValueWithUnknownKey()
        {
            var key           = new ConfigurationKey <int>("b");
            var configuration = new ConstantConfiguration(new Dictionary <ConfigurationKeyBase, object>());

            Assert.Throws <ArgumentException>(() => configuration.Value(key));
        }
Esempio n. 2
0
        public void ValueWithKnownKey()
        {
            var value         = "a";
            var key           = new ConfigurationKey <string>("b");
            var configuration = new ConstantConfiguration(
                new Dictionary <ConfigurationKeyBase, object>
            {
                [key] = value
            });

            Assert.AreSame(value, configuration.Value(key));
        }
Esempio n. 3
0
        public void ValueWithNullKey()
        {
            var configuration = new ConstantConfiguration(new Dictionary <ConfigurationKeyBase, object>());

            Assert.Throws <ArgumentNullException>(() => configuration.Value <int>(null));
        }