Exemplo n.º 1
0
        public IniFileConfigStoreTest()
        {
            //get back clean file
            string src = Path.Combine(BuildDir.FullName, "TestData", "example.ini");

            _testFilePath = Path.Combine(TestDir.FullName, "example.ini");
            File.Copy(src, _testFilePath, true);

            //create the store
            _store = new IniFileConfigStore(_testFilePath, true, true);
        }
Exemplo n.º 2
0
        public void Write_NewFileWithNewValues_WritesCorrectText()
        {
            string fullPath = Path.Combine(TestDir.FullName, Guid.NewGuid() + ".ini");
            var    ini      = new IniFileConfigStore(fullPath, true, true);

            ini.Write("key0", "value0");
            ini.Write("S1.key0", "s1value0");
            ini.Write("S2.key0", "s2value0");

            string resultText = File.ReadAllText(fullPath);

            Assert.Equal(
                @"key0=value0

[S1]
key0=s1value0

[S2]
key0=s2value0
", resultText, false, true);
        }
Exemplo n.º 3
0
 public void Read_FileDoesNotExist_DoesNotFail()
 {
     var store = new IniFileConfigStore($"c:\\{Guid.NewGuid()}.ini", true, true);
 }