Skip to content

Commit 4d25d14

Browse files
committed
Added unit tests for async extension methods
1 parent b938939 commit 4d25d14

File tree

1 file changed

+0
-74
lines changed

1 file changed

+0
-74
lines changed

tests/CommandLine.Tests/Unit/ParserResultExtensionsTests.cs

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,6 @@ public static void Turn_sucessful_parsing_into_exit_code()
161161
0.Should().Be(expected);
162162
}
163163

164-
[Fact]
165-
public static async Task Turn_sucessful_parsing_into_exit_codeAsync()
166-
{
167-
var expected = await Parser.Default.ParseArguments<Simple_Options>(new[] { "--stringvalue", "value" })
168-
.MapResultAsync(_ => Task.FromResult(0), _ => Task.FromResult(-1));
169-
170-
0.Should().Be(expected);
171-
}
172-
173164
[Fact]
174165
public static void Turn_sucessful_parsing_into_exit_code_for_verbs()
175166
{
@@ -184,20 +175,6 @@ public static void Turn_sucessful_parsing_into_exit_code_for_verbs()
184175
2.Should().Be(expected);
185176
}
186177

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

210-
[Fact]
211-
public static async Task Turn_failed_parsing_into_exit_codeAsync()
212-
{
213-
var expected = await Parser.Default.ParseArguments<Simple_Options>(new[] { "-i", "aaa" })
214-
.MapResultAsync(_ => Task.FromResult(0), _ => Task.FromResult(-1));
215-
216-
(-1).Should().Be(expected);
217-
}
218-
219187
[Fact]
220188
public static void Turn_failed_parsing_into_exit_code_for_verbs()
221189
{
@@ -230,20 +198,6 @@ public static void Turn_failed_parsing_into_exit_code_for_verbs()
230198
3.Should().Be(expected);
231199
}
232200

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

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

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

0 commit comments

Comments
 (0)