Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo n.º 3
0
        public void ValueWithNullKey()
        {
            var configuration = new ConstantConfiguration(new Dictionary <ConfigurationKeyBase, object>());

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