using ICSharpCode.NAnt; using NUnit.Framework; using System; using System.IO; using System.Xml; namespace ICSharpCode.NAnt.Tests { /// /// Tests the class. /// [TestFixture] public class InvalidNAntBuildFileTestFixture { NAntBuildFile buildFile; [Test] public void ReadFile() { StringReader reader = new StringReader(""); buildFile = new NAntBuildFile(reader); Assert.IsTrue(buildFile.HasError); NAntBuildFileError error = buildFile.Error; Assert.AreEqual("Unexpected end of file has occurred. The following elements are not closed: project. Line 1, position 10.", error.Message, "Error message is incorrect."); Assert.AreEqual(1, error.Line, "Error's line number is incorrect."); Assert.AreEqual(10, error.Column, "Error's column number is incorrect."); } } }