diff options
Diffstat (limited to 'mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs')
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs new file mode 100644 index 0000000000..caa93f1b76 --- /dev/null +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Construction/ProjectItemElementTest.cs @@ -0,0 +1,42 @@ +using System; +using System.IO; +using System.Linq; +using System.Xml; +using Microsoft.Build.Construction; +using NUnit.Framework; +using Microsoft.Build.Evaluation; +using Microsoft.Build.Exceptions; + +namespace MonoTests.Microsoft.Build.Construction +{ + [TestFixture] + public class ProjectItemElementTest + { + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void EmptyInclude () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo Include='' /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + + [Test] + [ExpectedException (typeof (InvalidProjectFileException))] + public void MissingInclude () + { + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <Foo /> + </ItemGroup> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + ProjectRootElement.Create (xml); + } + } +} + |