Skip to content

Commit

Permalink
Tyrrrz#13 - Add tests - suggestions by command line only
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricel committed Mar 31, 2021
1 parent 802a28d commit f7c79e0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions CliFx.Tests/SuggestDirectiveSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@ public async Task Suggest_directive_accepts_command_line_by_environment_variable
stdOut.Should().Be(FormatExpectedOutput(expected), usecase);
}

[Theory]
[InlineData("supply all commands that match partially",
new[] { "[suggest]", "clifx.exe", "c" }, new[] { "cmd", "cmd02" })]
[InlineData("supply command options if match found, regardles of other partial matches (no options defined)",
new[] { "[suggest]", "clifx.exe", "cmd" }, new string[] { })]
public async Task Suggest_directive_suggests_commands_by_command_line_only(string usecase, string[] commandLine, string[] expected)
{
// Arrange
var application = TestApplicationFactory(_cmdCommandCs, _cmd2CommandCs)
.Build();

// Act
var exitCode = await application.RunAsync(commandLine);

var stdOut = FakeConsole.ReadOutputString();

// Assert
exitCode.Should().Be(0);
stdOut.Should().Be(FormatExpectedOutput(expected), usecase);
}

//[Theory]
//[InlineData("happy case", "clifx.exe c", "")]
//public async Task Suggest_directive_generates_suggestions(string because, string commandline, string expectedResult)
Expand Down

0 comments on commit f7c79e0

Please sign in to comment.