public void LoadWithoutNamespace() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load("without-namespace");
     Assert.AreEqual("without-namespace", config.Name);
     Assert.IsNull(config.CommonNodeParser);
     Assert.IsNull(config.WebNode);
 }
        public void MessengerProviderNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("desktop");

            MessengerProviderNode node = config.MessengerProviderNodes["SmsMessenger"] as MessengerProviderNode;

            Assert.IsNotNull(node);
            Assert.AreEqual("SmsMessenger", node.Name);
            Assert.AreEqual("Nohros.Test.Toolkit.Messaging.SmsMessenger, nohros.test.desktop", node.Type);
            Assert.AreEqual(null, node.AssemblyLocation);

            node = config.MessengerProviderNodes["SimpleMessenger"] as MessengerProviderNode;
            Assert.IsNotNull(node);
            Assert.AreEqual("SimpleMessenger", node.Name);
            Assert.AreEqual("Nohros.Test.Toolkit.Messaging.SimpleMessenger, nohros.test.desktop", node.Type);
            Assert.AreEqual(null, node.AssemblyLocation);

            string host, port;

            Assert.IsTrue(node.Options.TryGetValue("smtp-host", out host));
            Assert.IsTrue(node.Options.TryGetValue("smtp-port", out port));
            Assert.AreEqual(host, "smtp.acaoassessoria.com.br");
            Assert.AreEqual(port, "587");
        }
 public void MissingCommonNode() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load("missing-common");
     Assert.AreEqual("missing-common", config.Name);
     Assert.IsNull(config.CommonNodeParser);
     Assert.IsNull(config.WebNode);
 }
        public void Load()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("desktop");
            Assert.NotNull(config.CommonNodeParser);
            Assert.NotNull(config.WebNode);
        }
        public void MissingCommonNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("missing-common");
            Assert.AreEqual("missing-common", config.Name);
            Assert.IsNull(config.CommonNodeParser);
            Assert.IsNull(config.WebNode);
        }
        public void LoadWithoutNamespace()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("without-namespace");
            Assert.AreEqual("without-namespace", config.Name);
            Assert.IsNull(config.CommonNodeParser);
            Assert.IsNull(config.WebNode);
        }
Beispiel #7
0
        public void AutoLoadProperties()
        {
            TestingConfiguration config = new TestingConfiguration();

            Assert.AreEqual(false, config.Debug);
            Assert.AreEqual(0, config.Timeout);

            config.Load("desktop.config", "desktop");
            Assert.AreEqual(true, config.Debug);
            Assert.AreEqual(3000, config.Timeout);
        }
        public void RepositoryNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("repository-node");

            RepositoryNode node = config.RepositoryNodes["css-path"];

            Assert.IsNotNull(node);
            Assert.AreEqual(Path.Combine(config.Location, "css"), node.RelativePath);
        }
        public void ConnectionStringNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("desktop");

            ConnectionStringNode node = config.ConnectionStringNodes["nohros"];

            Assert.AreEqual("nohros", node.Name);
            Assert.AreEqual("dbo", node.DatabaseOwner);
            Assert.AreEqual("SQLSERVER", node.ConnectionString);
        }
Beispiel #10
0
        public void SelectNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("desktop.config", "desktop");
            Assert.IsNotNull(config.XmlElement);

            XmlNode node = AbstractConfiguration.SelectNode(config.XmlElement, "/nohros/common/providers");

            Assert.IsNull(node);

            node = AbstractConfiguration.SelectNode(config.XmlElement, "nohros/common/providers");
            Assert.IsNotNull(node);
        }
        public void DataProviderNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("desktop");

            DataProviderNode node = config.DataProviderNodes["NohrosDataProvider"] as DataProviderNode;

            Assert.AreEqual("NohrosDataProvider", node.Name);
            Assert.AreEqual("Nohros.Data.SqlNohrosDataProvider, nohros.data", node.Type);
            Assert.AreEqual(config.Location, node.Location);
            Assert.AreEqual("SQLSERVER", node.ConnectionString);
            Assert.AreEqual("dbo", node.DatabaseOwner);
            Assert.AreEqual(DataSourceType.MsSql, node.DataSourceType);
        }
Beispiel #12
0
        public void SelectNode() {
            TestingConfiguration config = new TestingConfiguration();
            config.Load("desktop.config", "desktop");
            Assert.IsNotNull(config.XmlElement);

            XmlNode node = AbstractConfiguration.SelectNode(config.XmlElement, "/nohros/common/providers");
            Assert.IsNull(node);

            node = AbstractConfiguration.SelectNode(config.XmlElement, "nohros/common/providers");
            Assert.IsNotNull(node);
        }
        public void LoadWithInvalidRootNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load((string)"invalidrootnode");
        }
        public void DataProviderNode() {
            TestingConfiguration config = new TestingConfiguration();
            config.Load("desktop");

            DataProviderNode node = config.DataProviderNodes["NohrosDataProvider"] as DataProviderNode;
            Assert.AreEqual("NohrosDataProvider", node.Name);
            Assert.AreEqual("Nohros.Data.SqlNohrosDataProvider, nohros.data", node.Type);
            Assert.AreEqual(config.Location, node.Location);
            Assert.AreEqual("SQLSERVER", node.ConnectionString);
            Assert.AreEqual("dbo", node.DatabaseOwner);
            Assert.AreEqual(DataSourceType.MsSql, node.DataSourceType);
        }
        public void MessengerProviderNode() {
            TestingConfiguration config = new TestingConfiguration();
            config.Load("desktop");

            MessengerProviderNode node = config.MessengerProviderNodes["SmsMessenger"] as MessengerProviderNode;
            Assert.IsNotNull(node);
            Assert.AreEqual("SmsMessenger", node.Name);
            Assert.AreEqual("Nohros.Test.Toolkit.Messaging.SmsMessenger, nohros.test.desktop", node.Type);
            Assert.AreEqual(null, node.AssemblyLocation);

            node = config.MessengerProviderNodes["SimpleMessenger"] as MessengerProviderNode;
            Assert.IsNotNull(node);
            Assert.AreEqual("SimpleMessenger", node.Name);
            Assert.AreEqual("Nohros.Test.Toolkit.Messaging.SimpleMessenger, nohros.test.desktop", node.Type);
            Assert.AreEqual(null, node.AssemblyLocation);

            string host, port;
            Assert.IsTrue(node.Options.TryGetValue("smtp-host", out host));
            Assert.IsTrue(node.Options.TryGetValue("smtp-port", out port));
            Assert.AreEqual(host, "smtp.acaoassessoria.com.br");
            Assert.AreEqual(port, "587");
        }
        public void ConnectionStringNode() {
            TestingConfiguration config = new TestingConfiguration();
            config.Load("desktop");

            ConnectionStringNode node = config.ConnectionStringNodes["nohros"];
            Assert.AreEqual("nohros", node.Name);
            Assert.AreEqual("dbo", node.DatabaseOwner);
            Assert.AreEqual("SQLSERVER", node.ConnectionString);
        }
Beispiel #17
0
        public void LoadWithNullRootElement()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load((string)null);
        }
 public void LoadWithInvalidRootNode() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load((string)"invalidrootnode");
 }
Beispiel #19
0
        public void AutoLoadProperties() {
            TestingConfiguration config = new TestingConfiguration();
            Assert.AreEqual(false, config.Debug);
            Assert.AreEqual(0, config.Timeout);

            config.Load("desktop.config", "desktop");
            Assert.AreEqual(true, config.Debug);
            Assert.AreEqual(3000, config.Timeout);
        }
 public void Load() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load("desktop");
     Assert.NotNull(config.CommonNodeParser);
     Assert.NotNull(config.WebNode);
 }
 public void RootedRepositoryNode() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load("rooted-repository");
 }
 public void MissingRepositoryNode() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load("missing-repository");
 }
        public void MissingRepositoryNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("missing-repository");
        }
Beispiel #24
0
 public void LoadWithInvalidRootElement() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load("desktop.config", "testing");
 }
Beispiel #25
0
 public void LoadWithNullRootElement() {
     TestingConfiguration config = new TestingConfiguration();
     config.Load((string)null);
 }
        public void RootedRepositoryNode()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("rooted-repository");
        }
Beispiel #27
0
        public void LoadWithInvalidRootElement()
        {
            TestingConfiguration config = new TestingConfiguration();

            config.Load("desktop.config", "testing");
        }
        public void RepositoryNode() {
            TestingConfiguration config = new TestingConfiguration();
            config.Load("repository-node");

            RepositoryNode node = config.RepositoryNodes["css-path"];
            Assert.IsNotNull(node);
            Assert.AreEqual(Path.Combine(config.Location, "css"), node.RelativePath);
        }