コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }