2017-04-05 18:30:45 +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 Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
using Xunit;
|
|
|
|
using FluentAssertions;
|
|
|
|
using HelpActual = Microsoft.DotNet.Tools.Help;
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Help.Tests
|
|
|
|
{
|
|
|
|
public class GivenThatIWantToShowHelpForDotnetHelpCommand : TestBase
|
|
|
|
{
|
|
|
|
private const string HelpText =
|
2017-06-27 00:17:51 +00:00
|
|
|
@"Usage: dotnet help [options] <COMMAND_NAME>
|
2017-04-05 18:30:45 +00:00
|
|
|
|
|
|
|
Arguments:
|
2018-04-30 20:42:47 +00:00
|
|
|
<COMMAND_NAME> The SDK command to launch online help for.
|
2017-04-05 18:30:45 +00:00
|
|
|
|
|
|
|
Options:
|
2018-04-30 20:42:47 +00:00
|
|
|
-h, --help Show command line help.";
|
2017-04-05 18:30:45 +00:00
|
|
|
|
|
|
|
[Theory]
|
|
|
|
[InlineData("--help")]
|
|
|
|
[InlineData("-h")]
|
|
|
|
[InlineData("-?")]
|
|
|
|
[InlineData("/?")]
|
|
|
|
public void WhenHelpOptionIsPassedToDotnetHelpCommandItPrintsUsage(string helpArg)
|
|
|
|
{
|
|
|
|
var cmd = new HelpCommand()
|
|
|
|
.ExecuteWithCapturedOutput($"{helpArg}");
|
|
|
|
cmd.Should().Pass();
|
2017-06-14 02:24:30 +00:00
|
|
|
cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText);
|
2017-04-05 18:30:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|