public void Execute_NoProjectFile_ShouldLookupProjectFileInWorkDirectory() { var workDirectory = new DirectoryStub("Src") { new DirectoryStub("DotNet") { new DirectoryStub("Build"), new FileStub("Rosalia.sln") }, new DirectoryStub("Artifacts"), new DirectoryStub("Scripts") }; var task = new MsBuildTask { ToolPath = "myMsBuild" }; task.AssertCommand( workDirectory["DotNet"]["Build"], (msBuildPath, msBuildArguments) => { Assert.That(msBuildArguments.Trim(), Is.EqualTo("Src\\DotNet\\Rosalia.sln")); }); }
public void Execute_HasProjectFile_ShouldGenerateCommandLine() { var task = new MsBuildTask { ToolPath = "myMsBuild", ProjectFile = new DefaultFile("projectFile") }; task.AssertCommand((msBuildPath, msBuildArguments) => { Assert.That(msBuildArguments.Trim(), Is.EqualTo("projectFile")); }); }
public void Execute_NoProjectFileAndNoSolutionInWorkDirectory_ShouldLeaveProjectFileBlank() { var workDirectory = new DirectoryStub("Src") { new DirectoryStub("DotNet") { new DirectoryStub("Build"), }, new DirectoryStub("Artifacts"), new DirectoryStub("Scripts") }; var task = new MsBuildTask { ToolPath = "myMsBuild" }; task.AssertCommand( workDirectory["DotNet"]["Build"], (msBuildPath, msBuildArguments) => { Assert.That(msBuildArguments.Trim(), Is.Empty); }); }
public void Execute_ToolPathPrivided_ShouldUseToolPath() { var task = new MsBuildTask { ToolPath = "myMsBuild", ProjectFile = new DefaultFile("projectFile") }; task.AssertCommand( (msBuildPath, msBuildArguments) => { Assert.That(msBuildPath, Is.EqualTo("myMsBuild")); }); }