Exemplo n.º 1
0
        public void TestConnectionsJson() {
            var json = "{}";

            var cfg = new EmptyListCfg(json);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(0, cfg.Connections.Count);

        }
Exemplo n.º 2
0
        public void TestConnectionsJson()
        {
            var json = "{}";

            var cfg      = new EmptyListCfg(json);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(0, cfg.Connections.Count);
        }
Exemplo n.º 3
0
        public void TestConnectionsXml() {
            var xml = @"
                <cfg>
                </cfg>
            ".Replace("'", "\"");

            var cfg = new EmptyListCfg(xml);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(0, cfg.Connections.Count);

        }
Exemplo n.º 4
0
        public void TestConnectionsXml()
        {
            var xml = @"
                <cfg>
                </cfg>
            ".Replace("'", "\"");

            var cfg      = new EmptyListCfg(xml);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(0, cfg.Connections.Count);
        }
Exemplo n.º 5
0
        public void TestOtherThingsJson()
        {
            var json = @"{
                    'connections':[
                        { 'provider':'file', 'file':'c:\\temp.txt' }
                    ]
                }
            ".Replace("'", "\"");

            var cfg      = new EmptyListCfg(json);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(1, cfg.Connections.Count);
            Assert.IsNotNull(cfg.Connections[0].OtherThings);
            Assert.AreEqual(0, cfg.Connections[0].OtherThings.Count);
        }
Exemplo n.º 6
0
        public void TestOtherThingsXml() {
            var xml = @"
                <cfg>
                    <connections>
                        <add provider='file' file='c:\temp.txt' />
                    </connections>
                </cfg>
            ".Replace("'", "\"");

            var cfg = new EmptyListCfg(xml);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(1, cfg.Connections.Count);
            Assert.IsNotNull(cfg.Connections[0].OtherThings);
            Assert.AreEqual(0, cfg.Connections[0].OtherThings.Count);

        }
Exemplo n.º 7
0
        public void TestOtherThingsXml()
        {
            var xml = @"
                <cfg>
                    <connections>
                        <add provider='file' file='c:\temp.txt' />
                    </connections>
                </cfg>
            ".Replace("'", "\"");

            var cfg      = new EmptyListCfg(xml);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(1, cfg.Connections.Count);
            Assert.IsNotNull(cfg.Connections[0].OtherThings);
            Assert.AreEqual(0, cfg.Connections[0].OtherThings.Count);
        }
Exemplo n.º 8
0
        public void TestOtherThingsJson() {
            var json = @"{
                    'connections':[
                        { 'provider':'file', 'file':'c:\\temp.txt' }
                    ]
                }
            ".Replace("'", "\"");

            var cfg = new EmptyListCfg(json);
            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);
            Assert.IsNotNull(cfg.Connections);
            Assert.AreEqual(1, cfg.Connections.Count);
            Assert.IsNotNull(cfg.Connections[0].OtherThings);
            Assert.AreEqual(0, cfg.Connections[0].OtherThings.Count);

        }