BadScript 2
Loading...
Searching...
No Matches
Issue70Tests.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 #70
9
//When the factory overload is used for ParseArguments, there should be no constraint not having an empty constructor.
10
11
namespace
CommandLine.Tests.Unit
12
{
13
public
class
Issue70Tests
14
{
15
[Fact]
16
public
void
Create_instance_with_factory_method_should_not_fail
()
17
{
18
bool
actual =
false
;
19
20
var arguments =
new
[] {
"--amend"
};
21
var result =
Parser
.
Default
.
ParseArguments
(() =>
Mutable_Without_Empty_Constructor
.
Create
(), arguments);
22
result.WithParsed(options => {
23
actual = options.Amend;
24
});
25
26
actual.Should().BeTrue();
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.Mutable_Without_Empty_Constructor
Definition
Mutable_Without_Empty_Constructor.cs:6
CommandLine.Tests.Fakes.Mutable_Without_Empty_Constructor.Create
static Mutable_Without_Empty_Constructor Create()
Definition
Mutable_Without_Empty_Constructor.cs:14
CommandLine.Tests.Unit.Issue70Tests
Definition
Issue70Tests.cs:14
CommandLine.Tests.Unit.Issue70Tests.Create_instance_with_factory_method_should_not_fail
void Create_instance_with_factory_method_should_not_fail()
Definition
Issue70Tests.cs:16
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
Issue70Tests.cs
Generated by
1.9.8