-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from nblumhardt/help-ordering
Correct the ordering of sub-commands in generated (Markdown) help
- Loading branch information
Showing
3 changed files
with
40 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Seq.Api; | ||
using SeqCli.EndToEnd.Support; | ||
using Serilog; | ||
using Xunit; | ||
|
||
#nullable enable | ||
|
||
namespace SeqCli.EndToEnd.Help | ||
{ | ||
public class MarkdownHelpTestCase : ICliTestCase | ||
{ | ||
public Task ExecuteAsync(SeqConnection connection, ILogger logger, CliCommandRunner runner) | ||
{ | ||
var exit = runner.Exec("help", "--markdown", disconnected: true); | ||
Assert.Equal(0, exit); | ||
|
||
var markdown = runner.LastRunProcess!.Output; | ||
|
||
Assert.StartsWith("## Commands", markdown); | ||
|
||
var indexOfTemplateExport = markdown.IndexOf("### `template export`", StringComparison.Ordinal); | ||
var indexOfTemplateImport = markdown.IndexOf("### `template import`", StringComparison.Ordinal); | ||
Assert.NotEqual(indexOfTemplateExport, indexOfTemplateImport); | ||
Assert.True(indexOfTemplateExport < indexOfTemplateImport); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |