#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
917 B

using ICSharpCode.NAnt;
using NUnit.Framework;
using System;
using System.IO;
using System.Xml;
namespace ICSharpCode.NAnt.Tests
{
/// <summary>
/// Tests the <see cref="NAntBuildFile"/> class.
/// </summary>
[TestFixture]
public class InvalidNAntBuildFileTestFixture
{
NAntBuildFile buildFile;
[Test]
public void ReadFile()
{
StringReader reader = new StringReader("<project>");
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.");
}
}
}