mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
@@ -26,7 +26,7 @@ namespace CliFx.Tests
|
||||
);
|
||||
}
|
||||
|
||||
private static IEnumerable<TestCaseData> GetTestCases_HelpAndVersion_RunAsync()
|
||||
private static IEnumerable<TestCaseData> GetTestCases_RunAsync_Smoke()
|
||||
{
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(DefaultCommand)},
|
||||
@@ -53,6 +53,21 @@ namespace CliFx.Tests
|
||||
new string[0]
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(NamedCommand)},
|
||||
new[] {"-h"}
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(NamedCommand)},
|
||||
new[] {"--help"}
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(NamedCommand)},
|
||||
new[] {"--version"}
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(NamedCommand)},
|
||||
new[] {"cmd", "-h"}
|
||||
@@ -72,6 +87,21 @@ namespace CliFx.Tests
|
||||
new[] {typeof(FaultyCommand3)},
|
||||
new[] {"faulty3", "-h"}
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(DefaultCommand)},
|
||||
new[] {"[preview]"}
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(FaultyCommand1)},
|
||||
new[] {"faulty1", "[preview]"}
|
||||
);
|
||||
|
||||
yield return new TestCaseData(
|
||||
new[] {typeof(FaultyCommand1)},
|
||||
new[] {"faulty1", "[preview]", "-o", "value"}
|
||||
);
|
||||
}
|
||||
|
||||
private static IEnumerable<TestCaseData> GetTestCases_RunAsync_Negative()
|
||||
@@ -126,8 +156,8 @@ namespace CliFx.Tests
|
||||
}
|
||||
|
||||
[Test]
|
||||
[TestCaseSource(nameof(GetTestCases_HelpAndVersion_RunAsync))]
|
||||
public async Task RunAsync_HelpAndVersion_Test(IReadOnlyList<Type> commandTypes, IReadOnlyList<string> commandLineArguments)
|
||||
[TestCaseSource(nameof(GetTestCases_RunAsync_Smoke))]
|
||||
public async Task RunAsync_Smoke_Test(IReadOnlyList<Type> commandTypes, IReadOnlyList<string> commandLineArguments)
|
||||
{
|
||||
// Arrange
|
||||
using (var stdout = new StringWriter())
|
||||
|
||||
Reference in New Issue
Block a user