Skip to content

Commit 75de874

Browse files
joseangelmtmoh-hassan
authored andcommitted
Added unit tests for async extension methods
1 parent a362f90 commit 75de874

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

tests/CommandLine.Tests/Unit/ParserResultExtensionsTests.cs

-74
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,6 @@ public static void Turn_sucessful_parsing_into_exit_code()
159159
0.Should().Be(expected);
160160
}
161161

162-
[Fact]
163-
public static async Task Turn_sucessful_parsing_into_exit_codeAsync()
164-
{
165-
var expected = await Parser.Default.ParseArguments<Simple_Options>(new[] { "--stringvalue", "value" })
166-
.MapResultAsync(_ => Task.FromResult(0), _ => Task.FromResult(-1));
167-
168-
0.Should().Be(expected);
169-
}
170-
171162
[Fact]
172163
public static void Turn_sucessful_parsing_into_exit_code_for_verbs()
173164
{
@@ -182,20 +173,6 @@ public static void Turn_sucessful_parsing_into_exit_code_for_verbs()
182173
2.Should().Be(expected);
183174
}
184175

185-
[Fact]
186-
public static async Task Turn_sucessful_parsing_into_exit_code_for_verbsAsync()
187-
{
188-
var expected = await Parser.Default.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb>(
189-
new[] { "clone", "https://value.org/user/file.git" })
190-
.MapResultAsync(
191-
(Add_Verb opts) => Task.FromResult(0),
192-
(Commit_Verb opts) => Task.FromResult(1),
193-
(Clone_Verb opts) => Task.FromResult(2),
194-
errs => Task.FromResult(3));
195-
196-
2.Should().Be(expected);
197-
}
198-
199176
[Fact]
200177
public static void Turn_failed_parsing_into_exit_code()
201178
{
@@ -205,15 +182,6 @@ public static void Turn_failed_parsing_into_exit_code()
205182
(-1).Should().Be(expected);
206183
}
207184

208-
[Fact]
209-
public static async Task Turn_failed_parsing_into_exit_codeAsync()
210-
{
211-
var expected = await Parser.Default.ParseArguments<Simple_Options>(new[] { "-i", "aaa" })
212-
.MapResultAsync(_ => Task.FromResult(0), _ => Task.FromResult(-1));
213-
214-
(-1).Should().Be(expected);
215-
}
216-
217185
[Fact]
218186
public static void Turn_failed_parsing_into_exit_code_for_verbs()
219187
{
@@ -228,20 +196,6 @@ public static void Turn_failed_parsing_into_exit_code_for_verbs()
228196
3.Should().Be(expected);
229197
}
230198

231-
[Fact]
232-
public static async Task Turn_failed_parsing_into_exit_code_for_verbsAsync()
233-
{
234-
var expected = await Parser.Default.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb>(
235-
new[] { "undefined", "-xyz" })
236-
.MapResultAsync(
237-
(Add_Verb opts) => Task.FromResult(0),
238-
(Commit_Verb opts) => Task.FromResult(1),
239-
(Clone_Verb opts) => Task.FromResult(2),
240-
errs => Task.FromResult(3));
241-
242-
3.Should().Be(expected);
243-
}
244-
245199
[Fact]
246200
public static void Invoke_parsed_lambda_when_parsed_for_base_verbs()
247201
{
@@ -283,18 +237,6 @@ public static void Turn_sucessful_parsing_into_exit_code_for_single_base_verbs()
283237
1.Should().Be(expected);
284238
}
285239

286-
[Fact]
287-
public static async Task Turn_sucessful_parsing_into_exit_code_for_single_base_verbsAsync()
288-
{
289-
var expected = await Parser.Default.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb, Derived_Verb>(
290-
new[] { "derivedadd", "dummy.bin" })
291-
.MapResultAsync(
292-
(Base_Class_For_Verb opts) => Task.FromResult(1),
293-
errs => Task.FromResult(2));
294-
295-
1.Should().Be(expected);
296-
}
297-
298240
[Fact]
299241
public static void Turn_sucessful_parsing_into_exit_code_for_multiple_base_verbs()
300242
{
@@ -310,21 +252,5 @@ public static void Turn_sucessful_parsing_into_exit_code_for_multiple_base_verbs
310252

311253
4.Should().Be(expected);
312254
}
313-
314-
[Fact]
315-
public static async Task Turn_sucessful_parsing_into_exit_code_for_multiple_base_verbsAsync()
316-
{
317-
var expected = await Parser.Default.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb, Derived_Verb>(
318-
new[] { "derivedadd", "dummy.bin" })
319-
.MapResultAsync(
320-
(Add_Verb opts) => Task.FromResult(0),
321-
(Commit_Verb opts) => Task.FromResult(1),
322-
(Clone_Verb opts) => Task.FromResult(2),
323-
(Base_Class_For_Verb opts) => Task.FromResult(4),
324-
(Derived_Verb opts) => Task.FromResult(3),
325-
errs => Task.FromResult(5));
326-
327-
4.Should().Be(expected);
328-
}
329255
}
330256
}

0 commit comments

Comments
 (0)