Ejemplo n.º 1
0
        public void GivenAnArrayTargetTypeWithARankGreaterThanOne_ThrowsInvalidOperationException()
        {
            var config = new ConfigurationBuilder()
                         .AddInMemoryCollection(new Dictionary <string, string>
            {
                { "foo:bar:0", "123.45" },
                { "foo:bar:1", "456.78" },
            })
                         .Build();

            var fooSection = config.GetSection("foo");
            var actual     = Assert.Throws <InvalidOperationException>(() => fooSection.Create <MultiDimensionalArrayPropertyClass>());

#if DEBUG
            var expected = Exceptions.ArrayRankGreaterThanOneIsNotSupported(typeof(double[, ]));
            Assert.Equal(expected.Message, actual.Message);
#endif
        }