BadScript 2
Loading...
Searching...
No Matches
Issue424Tests.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using Xunit;
4
6{
7
8 //MailAndSmsWarningSenderTests
9 public class Issue424Tests
10 {
12
14 {
16 }
17
18 [Fact]
19 public void SendSmsOnWarning()
20 {
21 //Arrange
22 void Action() => _sut.ParseArgumentsAndRun(
23 new[] { "--task", "MailAndSmsWarningSender", "--test", "hejtest" });
24 // Act & Assert
25 Assert.Throws<NotImplementedException>((Action)Action);
26 }
27 }
28
30 {
31 internal class Options
32 {
33 [Option("task")]
34 public string Task { get; set; }
35 }
36
37 public void ParseArgumentsAndRun(string[] args)
38 {
40 .WithParsed(ExecuteTaskWithOptions)
41 .WithNotParsed(HandleParseError);
42 }
43
44 private void HandleParseError(IEnumerable<Error> errs)
45 {
46 throw new NotImplementedException();
47 }
48
50 {
51 Console.WriteLine("Executing");
52 }
53
54 }
55}
Provides methods to parse command line arguments.
Definition Parser.cs:21
ParserResult< object > ParseArguments(IEnumerable< string > args, params Type[] types)
Parses a string array of command line arguments for verb commands scenario, constructing the proper i...
Definition Parser.cs:216
static Parser Default
Gets the singleton instance created with basic defaults.
Definition Parser.cs:75
void HandleParseError(IEnumerable< Error > errs)