Skip to content

Commit 6a4c193

Browse files
committed
补充更多单元测试
1 parent 1ed7e81 commit 6a4c193

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/DotNetCampus.CommandLine.Tests/ParsingStyles/ParsingNotFoundTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ public class OptionNotFoundTests
2222
[DataRow(new[] { "--not-exist", "test1", "test2", "--option", "value" }, DotNet, DisplayName = "[DotNet] --not-exist test --option value")]
2323
[DataRow(new[] { "--not-exist", "test1", "test2", "--option", "value" }, Gnu, DisplayName = "[Gnu] --not-exist test --option value")]
2424
[DataRow(new[] { "-NotExist", "test1", "test2", "-Option", "value" }, PowerShell, DisplayName = "[PowerShell] -NotExist test -Option value")]
25+
[DataRow(new[] { "--not-exist", "a=b,c;d", "--option", "value" }, Flexible, DisplayName = "[Flexible] --not-exist test --option value")]
26+
[DataRow(new[] { "--not-exist", "a=b,c;d", "--option", "value" }, DotNet, DisplayName = "[DotNet] --not-exist test --option value")]
27+
[DataRow(new[] { "--not-exist", "a=b,c;d", "--option", "value" }, Gnu, DisplayName = "[Gnu] --not-exist test --option value")]
28+
[DataRow(new[] { "-NotExist", "a=b,c;d", "-Option", "value" }, PowerShell, DisplayName = "[PowerShell] -NotExist test -Option value")]
2529
public void OptionNotFound_IgnoreAllUnknownArguments(string[] args, TestCommandLineStyle style)
2630
{
2731
// Arrange
@@ -38,6 +42,10 @@ public void OptionNotFound_IgnoreAllUnknownArguments(string[] args, TestCommandL
3842
}
3943

4044
[TestMethod]
45+
[DataRow(new[] { "--not-exist=test1", "test2", "--option", "value" }, Flexible, DisplayName = "[Flexible] --not-exist test --option value")]
46+
[DataRow(new[] { "--not-exist=test1", "test2", "--option", "value" }, DotNet, DisplayName = "[DotNet] --not-exist test --option value")]
47+
[DataRow(new[] { "--not-exist=test1", "test2", "--option", "value" }, Gnu, DisplayName = "[Gnu] --not-exist test --option value")]
48+
[DataRow(new[] { "-NotExist=test1", "test2", "-Option", "value" }, PowerShell, DisplayName = "[PowerShell] -NotExist test -Option value")]
4149
[DataRow(new[] { "--not-exist", "test1", "test2", "--option", "value" }, Flexible, DisplayName = "[Flexible] --not-exist test --option value")]
4250
[DataRow(new[] { "--not-exist", "test1", "test2", "--option", "value" }, DotNet, DisplayName = "[DotNet] --not-exist test --option value")]
4351
[DataRow(new[] { "--not-exist", "test1", "test2", "--option", "value" }, Gnu, DisplayName = "[Gnu] --not-exist test --option value")]

0 commit comments

Comments
 (0)