public void CfgMgr_Null_CfgSysType() { string path = Path.Combine(localFolder, file_txt_1); configManager = new CfgManager(path, typeof(NullConfigSystem)); configManager.ReadConfig(); Assert.AreEqual(0, configManager.GetDictionary().Count, "Dictionary Size should be 0"); }
public void CfgMgr_Xml_Read_Empty() { string path = Path.Combine(localFolder, file_1_empty); XmlConfigSystem cfgsys = new XmlConfigSystem(); configManager = new CfgManager(path, cfgsys); configManager.ReadConfig(); Assert.AreEqual(0, configManager.GetDictionary().Count, "Dictionary should be empty"); }
public void CfgMgr_Ini_Read_NotExist() { string path = Path.Combine(localFolder, file_ini_1_notExist); IniConfigSystem cfgsys = new IniConfigSystem(); configManager = new CfgManager(path, cfgsys); configManager.ReadConfig(); Assert.AreEqual(0, configManager.GetDictionary().Count, "Dictionary should be empty"); }
public void CfgMgr_Xml_Read_CfgSysType() { string path = Path.Combine(localFolder, file_xml_1); configManager = new CfgManager(path, typeof(XmlConfigSystem)); configManager.ReadConfig(); Assert.AreEqual(5, configManager.GetDictionary().Count, "Dictionary Size should be 5"); string value1 = configManager.GetValue("long"); Assert.AreEqual("string with spaces", value1, "Content of \"long\" should be \"string with spaces\""); string value2 = configManager.GetValue("test"); Assert.AreEqual("value", value2, "Content for \"test\" should be \"value\""); string value3 = configManager.GetValue("bar"); Assert.AreEqual("", value3, "Content for \"bar\" should be empty"); }
public void CfgMgr_Ini_Read_CfgSysType() { string path = Path.Combine(localFolder, file_ini_1); configManager = new CfgManager(path, typeof(IniConfigSystem)); configManager.ReadConfig(); Assert.AreEqual(5, configManager.GetDictionary().Count, "Dictionary Size should be 5"); string value1 = configManager.GetValue("general_long"); Assert.AreEqual("string with more data", value1, "Content of \"general_long\" should be \"string with more data\""); string value2 = configManager.GetValue("general_foo"); Assert.AreEqual("bar", value2, "Content for \"general_foo\" should be \"bar\""); string value3 = configManager.GetValue("general_bar"); Assert.AreEqual("", value3, "Content for \"general_bar\" should be empty"); }
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"); }