2018-01-18 03:26:52 +00:00
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using FluentAssertions;
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Install.Tests
|
|
|
|
{
|
|
|
|
public class GivenDotnetInstallTool : TestBase
|
|
|
|
{
|
|
|
|
[Fact]
|
|
|
|
public void ItRunsWithQuietVerbosityByDefault()
|
|
|
|
{
|
2018-03-22 02:12:32 +00:00
|
|
|
var result = new ToolCommand()
|
|
|
|
.ExecuteWithCapturedOutput("install -g nonexistent_tool_package");
|
2018-01-18 03:26:52 +00:00
|
|
|
|
|
|
|
result
|
|
|
|
.Should()
|
|
|
|
.Fail()
|
|
|
|
.And
|
|
|
|
.NotHaveStdOutContaining("Restoring");
|
|
|
|
}
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
public void ItRunsWithTheSpecifiedVerbosity()
|
|
|
|
{
|
2018-03-22 02:12:32 +00:00
|
|
|
var result = new ToolCommand()
|
|
|
|
.ExecuteWithCapturedOutput("install -g -v:m nonexistent_tool_package");
|
2018-01-18 03:26:52 +00:00
|
|
|
|
|
|
|
result
|
|
|
|
.Should()
|
|
|
|
.Fail();
|
|
|
|
|
|
|
|
result
|
|
|
|
.StdOut
|
|
|
|
.Should()
|
|
|
|
.ContainVisuallySameFragmentIfNotLocalized("Restoring");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|