Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Create an MSBuild project and run it, within a unit test.
var projectRootElement = ProjectRootElement.Create();
projectRootElement.AddUsingTask(typeof (MyTask));
.SetParameter("Foo", "hi");
var highImportanceStringLogger = new HighImportanceStringLogger();
var success = new ProjectInstance(projectRootElement).Build(new[] { highImportanceStringLogger });
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