Beispiel #1
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);
        }
Beispiel #2
0
        public void Test_SaveParserConfigFile()
        {
            ParseConfig config      = new ParseConfig(TestHelper.GetNodeConfigPath());
            string      newFilePath = System.IO.Path.GetTempFileName();

            try
            {
                config.Save(newFilePath);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.ToString());
            }
            finally
            {
                File.Delete(newFilePath);
            }
        }