Merge pull request #819 from brendanzagaeski/patch-1
[mono.git] / mcs / class / Microsoft.Build.Tasks / Test / Microsoft.Build.Tasks / TaskBatchingTest.cs
index 6bfaae755e9ce3f38c2ff715d0480869ecf2784a..1461e176b4ae03be3e4245ed535dbf0e9c09983d 100755 (executable)
@@ -40,6 +40,12 @@ namespace MonoTests.Microsoft.Build.Tasks
        [TestFixture]
        public class TaskBatchingTest
        {
+               string projectHeader;
+               public TaskBatchingTest ()
+               {
+                       projectHeader = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" " + Consts.ToolsVersionString + ">";
+               }
+
                [Test]
                public void Test1 ()
                {
@@ -363,7 +369,8 @@ namespace MonoTests.Microsoft.Build.Tasks
                        CheckLoggedMessageAny (testLogger, "Number: 2 Color: Red-- Items in ExampColl:  ExampColl2: Item5", "A3");
                        CheckLoggedMessageAny (testLogger, "Number: 3 Color: Green-- Items in ExampColl:  ExampColl2: Item6", "A4");
                        CheckLoggedMessageAny (testLogger, "Number: 2 Color: -- Items in ExampColl: Item2 ExampColl2: ", "A5");
-                       Assert.AreEqual (0, testLogger.Count, "A6");
+                       Assert.AreEqual (0, testLogger.NormalMessageCount, "A6");
+                       Assert.AreEqual (0, testLogger.WarningMessageCount, "A7");
                        CheckEngineEventCounts (testLogger, 1, 1, 4, 4);
                }
 
@@ -453,7 +460,8 @@ namespace MonoTests.Microsoft.Build.Tasks
                        CheckLoggedMessageAny (testLogger, "Identity: Item4 -- Items in ExampColl: Item4;Item4", "A5");
                        CheckLoggedMessageAny (testLogger, "Identity: Item5 -- Items in ExampColl: Item5", "A6");
                        CheckLoggedMessageAny (testLogger, "Identity: Item6 -- Items in ExampColl: Item6", "A7");
-                       Assert.AreEqual (0, testLogger.Count, "A8");
+                       Assert.AreEqual (0, testLogger.NormalMessageCount, "A8");
+                       Assert.AreEqual (0, testLogger.WarningMessageCount, "A7");
                        CheckEngineEventCounts (testLogger, 1, 1, 6, 6);
                }
 
@@ -548,7 +556,7 @@ namespace MonoTests.Microsoft.Build.Tasks
                // batching should happen only on basis of the task attributes,
                // and not the resolved expression values
                public void TestBatching1 () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <item3 Include=""foo""/>
                <item2 Include=""%(item3.Identity)""/>
@@ -584,7 +592,7 @@ namespace MonoTests.Microsoft.Build.Tasks
                // batching should happen only on basis of the task attributes,
                // and not the resolved expression values
                public void TestConditionalBatching2 () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <item2 Include=""%(item3.Identity)""/>
                <item4 Include=""%(item2.Identity);@(item3)""/>
@@ -614,7 +622,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
                [Test]
                public void TestBatchingWithUnbatchedItems () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <Item1 Include=""One""/>
                <Item1 Include=""Two""/>
@@ -651,7 +659,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
                [Test]
                public void TestPropertiesWithBatchedReferences () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <Item1 Include=""One""/>
                <Item1 Include=""Two""/>
@@ -693,7 +701,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
                [Test]
                public void TestPropertiesWithDynamicItems () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <Item1 Include=""One""/>
                <Item1 Include=""Two""/>
@@ -748,7 +756,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
                [Test]
                public void TestTargetInvocationFromBatchedTask () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <Item1 Include=""One""/>
                <Item1 Include=""Two""/>
@@ -799,7 +807,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
                [Test]
                public void TestTargetInvocationFromBatchedTarget () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <Item1 Include=""One""/>
                <Item1 Include=""Two""/>
@@ -864,7 +872,7 @@ namespace MonoTests.Microsoft.Build.Tasks
 
                [Test]
                public void TestBatchingWithUnqualifiedMetadataReference () {
-                       string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+                       string projectString = projectHeader + @"
        <ItemGroup>
                <Item1 Include=""One""><Md>1</Md></Item1>
                <Item1 Include=""Two""><Md>2</Md></Item1>
@@ -899,7 +907,6 @@ namespace MonoTests.Microsoft.Build.Tasks
                                testLogger.DumpMessages ();
                                Assert.Fail ("Build failed");
                        }
-                       testLogger.DumpMessages ();
 
                        try {
                                testLogger.CheckLoggedAny ("For md: 3 Item1:  Item1Ref:  Item2: Three Item2Ref: Three  Prop1:  Prop1Ref:  Prop2: Three Prop2Ref: Three", MessageImportance.Normal, "A1");