Last active
December 28, 2015 15:09
-
-
Save JayBazuzi/7519460 to your computer and use it in GitHub Desktop.
Create an MSBuild project and run it, within a unit test.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var projectRootElement = ProjectRootElement.Create(); | |
projectRootElement.AddUsingTask(typeof (MyTask)); | |
projectRootElement | |
.AddTarget("Build") | |
.AddTask(typeof(MyTask).Name) | |
.SetParameter("Foo", "hi"); | |
var highImportanceStringLogger = new HighImportanceStringLogger(); | |
var success = new ProjectInstance(projectRootElement).Build(new[] { highImportanceStringLogger }); | |
Assert.IsTrue(success); | |
const string expected = @"Inputs: | |
Foo = hi | |
"; | |
Assert.AreEqual(expected, highImportanceStringLogger.ToString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment