[xbuild] Fix Tooltask.ToolPath behaviour to match .NET
[mono.git] / mcs / class / Microsoft.Build.Utilities / Test / Microsoft.Build.Utilities / ToolTaskTest.cs
index 8b3ae6e69c4960c135363ad7afc0f2d5202d1c0d..a76e13f1be649eebf63266f4ee7ac3714603926d 100644 (file)
@@ -56,6 +56,23 @@ namespace MonoTests.Microsoft.Build.Utilities {
                                task.Codes.Clear ();
                        }
                }
+
+               [Test]
+               public void ToolExeAndPath ()
+               {
+                       TestToolTask a = new TestToolTask ();
+                       Assert.AreEqual (a.ToolExe, "TestTool.exe", "#1");
+                       a.ToolExe = "Foo";
+                       Assert.AreEqual (a.ToolExe, "Foo", "#2");
+                       a.ToolExe = "";
+                       Assert.AreEqual (a.ToolExe, "TestTool.exe", "#3");
+
+                       Assert.AreEqual (a.ToolPath, null, "#4");
+                       a.ToolPath = "Bar";
+                       Assert.AreEqual (a.ToolPath, "Bar", "#5");
+                       a.ToolPath = "";
+                       Assert.AreEqual (a.ToolPath, "", "#6");
+               }
        }
 
        class LogEventsFromTextOutputToolTask : ToolTask {
@@ -137,5 +154,17 @@ namespace MonoTests.Microsoft.Build.Utilities {
                        Codes.Add (e.Code);
                }
        }
+
+       class TestToolTask : ToolTask {
+
+               protected override string ToolName {
+                       get { return "TestTool.exe"; }
+               }
+
+               protected override string GenerateFullPathToTool ()
+               {
+                       throw new NotImplementedException ();
+               }
+       }
 }