public void TestWrongPropertyKey() { var parser = new IniParser.IniParser("lab1.data.ini"); var data = parser.Parse(); var ex = Assert.ThrowsException <IniParser.IniParserException.PropertyKeyNotFound>(() => data.TryGetInt("COMMON", "StatisterTime")); Assert.AreEqual("Property StatisterTime was not found!", ex.Message); }
public void TestWrongParameterValueType() { var parser = new IniParser.IniParser("lab1.data.ini"); var data = parser.Parse(); var ex = Assert.ThrowsException <IniParser.IniParserException.BadValueCast>(() => data.TryGet <int>("COMMON", "DiskCachePath")); Assert.AreEqual("Type of /sata/panorama can not be converted to Int32!", ex.Message); }
public void TestWrongSection() { var parser = new IniParser.IniParser("lab1.data.ini"); var data = parser.Parse(); var ex = Assert.ThrowsException <IniParser.IniParserException.SectionNotFound>(() => data.TryGetInt("COMMO", "StatisterTimeMs")); Assert.AreEqual("Section COMMO was not found!", ex.Message); }