Esempio n. 1
0
        public void Can_GetConnectionString()
        {
            foreach (var dbName in ConfigTool.GetDatabaseNames())
            {
                if (dbName.StartsWith("Local"))
                {
                    continue;
                }

                Assert.IsTrue(ConfigTool.HasConnectionString(dbName));
                Assert.IsNotEmpty(ConfigTool.GetConnectionString(dbName));
            }
        }
Esempio n. 2
0
        public void Can_GetConnectionStringSettings()
        {
            foreach (var connSettings in ConfigTool.GetConnectionStringSettings())
            {
                Assert.IsNotNull(connSettings);
                Assert.IsNotEmpty(connSettings.Name);


                if (connSettings.Name.StartsWith("Local") == false)
                {
                    Assert.IsNotEmpty(connSettings.ConnectionString);
                }
            }
        }
Esempio n. 3
0
        public void Can_GetAppSettings()
        {
            Assert.IsTrue(ConfigTool.HasAppSettings("key1"));
            Assert.IsTrue(ConfigTool.HasAppSettings("key2"));
            Assert.IsNotEmpty(ConfigTool.GetAppSettings("key1", string.Empty));
            Assert.IsNotEmpty(ConfigTool.GetAppSettings("key2", string.Empty));

            if (IsDebugEnabled)
            {
                log.Debug(ConfigTool.GetAppSettings("key1", string.Empty));
            }

            // 키가 없으므로 string.Empty 를 반환할 것이다
            Assert.IsFalse(ConfigTool.HasAppSettings("unknown"));
            Assert.IsEmpty(ConfigTool.GetAppSettings("unknown", string.Empty));
        }