parent
7f50f322d5
commit
05b0b64e55
2 changed files with 24 additions and 0 deletions
|
@ -100,6 +100,9 @@ namespace Microsoft.DotNet.Tools.Add.PackageReference
|
|||
// Turn off restore for Dotnet cli tool references so that we do not generate extra dg specs
|
||||
args.Add($"/p:RestoreDotnetCliToolReferences=false");
|
||||
|
||||
// Output should not include MSBuild version header
|
||||
args.Add("/nologo");
|
||||
|
||||
var result = new MSBuildForwardingApp(args).Execute();
|
||||
|
||||
if (result != 0)
|
||||
|
|
|
@ -116,6 +116,27 @@ namespace Microsoft.DotNet.Cli.Package.Add.Tests
|
|||
cmd.StdErr.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenValidPackageIsPassedMSBuildDoesNotPrintVersionHeader()
|
||||
{
|
||||
var testAsset = "TestAppSimple";
|
||||
var projectDirectory = TestAssets
|
||||
.Get(testAsset)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.Root
|
||||
.FullName;
|
||||
|
||||
var packageName = "Newtonsoft.Json";
|
||||
var packageVersion = "9.0.1";
|
||||
var cmd = new DotnetCommand()
|
||||
.WithWorkingDirectory(projectDirectory)
|
||||
.ExecuteWithCapturedOutput($"add package {packageName} --version {packageVersion}");
|
||||
cmd.Should().Pass();
|
||||
cmd.StdOut.Should().NotContain("Microsoft (R) Build Engine version");
|
||||
cmd.StdErr.Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenMultiplePackagesArePassedCommandFails()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue