예제 #1
0
        public void ArraysAreConvertedToKeyValuePairs()
        {
            var Taml =
                @"ip
	1.2.3.4
	7.8.9.10
	11.12.13.14"    ;

            var TamlConfigSource = new TamlConfigurationProvider(new TamlConfigurationSource());

            TamlConfigSource.Load(TestStreamHelpers.StringToStream(Taml));

            Assert.Equal("1.2.3.4", TamlConfigSource.Get("ip:0"));
            Assert.Equal("7.8.9.10", TamlConfigSource.Get("ip:1"));
            Assert.Equal("11.12.13.14", TamlConfigSource.Get("ip:2"));
        }
예제 #2
0
        public void NestedArrays()
        {
            var Taml =
                @"ip
	First
		1.2.3.4
		5.6.7.8
	Second
		9.10.11.12
		13.14.15.16"        ;

            var TamlConfigSource = new TamlConfigurationProvider(new TamlConfigurationSource());

            TamlConfigSource.Load(TestStreamHelpers.StringToStream(Taml));

            Assert.Equal("1.2.3.4", TamlConfigSource.Get("ip:First:0"));
            Assert.Equal("5.6.7.8", TamlConfigSource.Get("ip:First:1"));
            Assert.Equal("9.10.11.12", TamlConfigSource.Get("ip:Second:0"));
            Assert.Equal("13.14.15.16", TamlConfigSource.Get("ip:Second:1"));
        }
예제 #3
0
        public void ArrayOfObjects()
        {
            var Taml =
                @"ip
	First
		address	1.2.3.4
		hidden	False
	Second
		address	5.6.7.8
		hidden	True"        ;

            var TamlConfigSource = new TamlConfigurationProvider(new TamlConfigurationSource());

            TamlConfigSource.Load(TestStreamHelpers.StringToStream(Taml));

            Assert.Equal("1.2.3.4", TamlConfigSource.Get("ip:First:address"));
            Assert.Equal("False", TamlConfigSource.Get("ip:First:hidden"));
            Assert.Equal("5.6.7.8", TamlConfigSource.Get("ip:Second:address"));
            Assert.Equal("True", TamlConfigSource.Get("ip:Second:hidden"));
        }