コード例 #1
0
        public void WrongFileFormat()
        {
            var parser = new IniParser.IniParser("test.in");

            var ex = Assert.ThrowsException <IniParser.IniParserException.WrongFileFormat>(() => parser.ReadData());

            Assert.AreEqual("Wrong file format! It should be '.ini'!", ex.Message);
        }
コード例 #2
0
        public void TestFileNotFound()
        {
            var parser = new IniParser.IniParser("lab1.in");

            var ex = Assert.ThrowsException <IniParser.IniParserException.FileNotFound>(() => parser.ReadData());

            Assert.AreEqual("This file was not found!", ex.Message);
        }