Beispiel #1
0
        public void Test_GetDefaultConfigValueNoGroup()
        {
            ParseConfig config = new ParseConfig(TestHelper.GetNodeConfigPath());

            string value = config.GetValue("not existant", "not existant", "Value");

            Assert.AreEqual("Value", value);
        }
Beispiel #2
0
        public void Test_GetSectionConfigValue()
        {
            ParseConfig config = new ParseConfig(TestHelper.GetNodeConfigPath());

            string value = config.GetValue("CONFIG_VALUE", "Test Group");

            Assert.AreEqual("testing", value);
        }
Beispiel #3
0
        public void Test_GetConfigValue()
        {
            ParseConfig config = new ParseConfig(TestHelper.GetNodeConfigPath());

            string value = config.GetValue("CLOUD_DOMAIN");

            Assert.AreEqual("example.com", value);
        }
Beispiel #4
0
        public void Test_GetConfigComents()
        {
            ParseConfig config = new ParseConfig(TestHelper.GetNodeConfigPath());

            string value = config.GetValue("MOTD_FILE");

            Assert.AreEqual(value, "");
        }
Beispiel #5
0
        public void Test_AddKeyParserConfig()
        {
            ParseConfig config      = new ParseConfig(TestHelper.GetNodeConfigPath());
            string      newFilePath = System.IO.Path.GetTempFileName();

            config.WriteValue("NEWKEY", "NEWVALUE");
            config.Save(newFilePath);
            ParseConfig newConfig = new ParseConfig(newFilePath);

            string value = newConfig.GetValue("NEWKEY");

            Assert.AreEqual("NEWVALUE", value);
            File.Delete(newFilePath);
        }