public void Combine_and_scope_should_work_correctly_when_same_source()
        {
            source = new JsonStringSource("{ 'a': { 'c': [1, 2, 3] }, 'b': { 'c': [4, 5] } }");

            provider.Get <int[]>(source.ScopeTo("a").CombineWith(source.ScopeTo("b"), new SettingsMergeOptions {
                ArrayMergeStyle = ArrayMergeStyle.Concat
            }).ScopeTo("c"))
            .Should()
            .BeEquivalentTo(new[] { 1, 2, 3, 4, 5 });
        }
Beispiel #2
0
        private static void PrintOptions(IConfigurationSource configSource)
        {
            var optionsSource = configSource.ScopeTo("options", "application");
            var options       = provider.Get <Dictionary <string, bool> >(optionsSource);

            Console.WriteLine("Options:");
            Console.WriteLine(ConfigurationPrinter.Print(options));
        }