Suppress output from dotnet run when using quiet verbosity level.

This commit suppresses the output that is displayed by the `dotnet run` command
when launch settings are being used, unless the verbosity level is above
"quiet".

Fixes #9545.
This commit is contained in:
Peter Huene 2018-07-25 15:09:36 -07:00
parent 8d75cf1300
commit 3018875d22
No known key found for this signature in database
GPG key ID: E1D265D820213D6A
2 changed files with 31 additions and 1 deletions

View file

@ -343,6 +343,7 @@ namespace Microsoft.DotNet.Cli.Run.Tests
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json");
new RestoreCommand()
.WithWorkingDirectory(testProjectDirectory)
@ -359,11 +360,33 @@ namespace Microsoft.DotNet.Cli.Run.Tests
.ExecuteWithCapturedOutput();
cmd.Should().Pass()
.And.NotHaveStdOutContaining(string.Format(LocalizableStrings.UsingLaunchSettingsFromMessage, launchSettingsPath))
.And.HaveStdOutContaining("First");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void ItPrintsUsingLaunchSettingsMessageWhenNotQuiet()
{
var testInstance = TestAssets.Get("AppWithLaunchSettings")
.CreateInstance()
.WithSourceFiles();
var testProjectDirectory = testInstance.Root.FullName;
var launchSettingsPath = Path.Combine(testProjectDirectory, "Properties", "launchSettings.json");
var cmd = new RunCommand()
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput("-v:m");
cmd.Should().Pass()
.And.HaveStdOutContaining(string.Format(LocalizableStrings.UsingLaunchSettingsFromMessage, launchSettingsPath))
.And.HaveStdOutContaining("First");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void ItPrefersTheValueOfAppUrlFromEnvVarOverTheProp()
{