BadScript 2
Loading...
Searching...
No Matches
Issue591Tests.cs
Go to the documentation of this file.
1
using
System.Linq;
2
using
CommandLine.Tests.Fakes
;
3
using
CommandLine.Text
;
4
using
FluentAssertions;
5
using
Xunit;
6
using
Xunit.Abstractions;
7
8
//Issue #591
9
//When options class is only having explicit interface declarations, it should be detected as mutable.
10
11
namespace
CommandLine.Tests.Unit
12
{
13
public
class
Issue591Tests
14
{
15
[Fact]
16
public
void
Parse_option_with_only_explicit_interface_implementation
()
17
{
18
string
actual =
string
.Empty;
19
20
var arguments =
new
[] {
"--inputfile"
,
"file2.txt"
};
21
var result =
Parser
.
Default
.
ParseArguments
<
Options_With_Only_Explicit_Interface
>(arguments);
22
result.WithParsed(options => {
23
actual = ((
IInterface_With_Two_Scalar_Options
)options).InputFile;
24
});
25
26
actual.Should().Be(
"file2.txt"
);
27
}
28
}
29
}
CommandLine.Parser
Provides methods to parse command line arguments.
Definition
Parser.cs:21
CommandLine.Parser.ParseArguments
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
CommandLine.Parser.Default
static Parser Default
Gets the singleton instance created with basic defaults.
Definition
Parser.cs:75
CommandLine.Tests.Fakes.Options_With_Only_Explicit_Interface
Definition
Options_With_Only_Explicit_Interface.cs:4
CommandLine.Tests.Unit.Issue591Tests
Definition
Issue591Tests.cs:14
CommandLine.Tests.Unit.Issue591Tests.Parse_option_with_only_explicit_interface_implementation
void Parse_option_with_only_explicit_interface_implementation()
Definition
Issue591Tests.cs:16
CommandLine.Tests.Fakes.IInterface_With_Two_Scalar_Options
Definition
IInterface_With_Two_Scalar_Options.cs:4
CommandLine.Tests.Fakes
Definition
Custom_Struct.cs:6
CommandLine.Tests.Unit
Definition
BaseAttributeTests.cs:5
CommandLine.Text
Definition
AssemblyLicenseAttribute.cs:7
deps
commandlineparser
tests
CommandLine.Tests
Unit
Issue591Tests.cs
Generated by
1.9.8