From 44d25ae3af946785d5997f6d13e41946e13ddce9 Mon Sep 17 00:00:00 2001 From: Mikkel Nylander Bundgaard Date: Mon, 14 Aug 2017 23:32:49 +0200 Subject: [PATCH] Add test for commands without doclink --- .../GivenThatIWantToShowHelpForDotnetCommand.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs index 8b66299d9..b4aacb067 100644 --- a/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs +++ b/test/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs @@ -89,6 +89,19 @@ runtime-options: cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); } + [Theory] + [InlineData("complete")] + [InlineData("parse")] + public void WhenCommandWithoutDocLinkIsPassedToDotnetHelpItPrintsError(string command) + { + var cmd = new DotnetCommand() + .ExecuteWithCapturedOutput($"help {command}"); + + cmd.Should().Fail(); + cmd.StdErr.Should().Contain(string.Format(Tools.Help.LocalizableStrings.CommandDoesNotExist, command)); + cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); + } + [WindowsOnlyFact] public void WhenRunOnWindowsDotnetHelpCommandShouldContainProperProcessInformation() {