Improve help text for commands that shell out to msbuild.
This commit is contained in:
Justin Goshi 2016-10-11 17:29:09 -07:00
parent 19abf66412
commit 59f2483fd3
9 changed files with 65 additions and 4 deletions

View file

@ -41,5 +41,39 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
.And
.HaveStdOutContaining("You want me to say 'GreatScott'");
}
[Theory]
// https://github.com/dotnet/cli/issues/4293
[InlineData("build", false)]
[InlineData("pack", false)]
[InlineData("publish", false)]
[InlineData("restore", false)]
[InlineData("run", false)]
[InlineData("build3", true)]
[InlineData("clean3", true)]
[InlineData("pack3", true)]
[InlineData("publish3", true)]
[InlineData("restore3", true)]
[InlineData("run3", true)]
public void ItMSBuildHelpText(string commandName, bool isMSBuildCommand)
{
const string MSBuildHelpText = " Any extra options that should be passed to MSBuild. See 'dotnet msbuild -h' for available options.";
var projectDirectory = TestAssetsManager.CreateTestDirectory("ItContainsMSBuildHelpText");
var result = new TestCommand("dotnet")
.WithWorkingDirectory(projectDirectory.Path)
.ExecuteWithCapturedOutput($"{commandName} --help");
result.ExitCode.Should().Be(0);
if (isMSBuildCommand)
{
result.StdOut.Should().Contain(MSBuildHelpText);
}
else
{
result.StdOut.Should().NotContain(MSBuildHelpText);
}
}
}
}