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); }
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); }
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); }
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); }