public void CfgMgr_Text_Read_Empty() { string path = Path.Combine(localFolder, file_1_empty); TextConfigSystem cfgsys = new TextConfigSystem(); configManager = new CfgManager(path, cfgsys); configManager.ReadConfig(); Assert.AreEqual(0, configManager.GetDictionary().Count, "Dictionary should be empty"); }
public void CfgMgr_Text_Write() { string path = Path.Combine(localFolder, file_txt_1_out); TextConfigSystem cfgsys = new TextConfigSystem(); configManager = new CfgManager(path, cfgsys); configManager.SetDictionary(dicoTxt); configManager.WriteConfig(); Assert.IsTrue(FileCompare(Path.Combine(localFolder, file_txt_1_out), Path.Combine(localFolder, file_txt_1)), "Files are not the same"); }
public void CfgMgr_Text_Read_CfgSysInstance() { string path = Path.Combine(localFolder, file_txt_1); TextConfigSystem cfgsys = new TextConfigSystem(); configManager = new CfgManager(path, cfgsys); configManager.ReadConfig(); Assert.AreEqual(5, configManager.GetDictionary().Count, "Dictionary Size should be 5"); string value1 = configManager.GetValue("long"); Assert.AreEqual("string with more data", value1, "Content of \"long\" should be \"string with more data\""); string value2 = configManager.GetValue("foo"); Assert.AreEqual("bar", value2, "Content for \"foo\" should be \"bar\""); string value3 = configManager.GetValue("bar"); Assert.AreEqual("", value3, "Content for \"bar\" should be empty"); }