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:
parent
8d75cf1300
commit
3018875d22
2 changed files with 31 additions and 1 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue