forked from commandlineparser/commandline
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue591Tests.cs
More file actions
29 lines (25 loc) · 853 Bytes
/
Copy pathIssue591Tests.cs
File metadata and controls
29 lines (25 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Linq;
using CommandLine.Tests.Fakes;
using CommandLine.Text;
using FluentAssertions;
using Xunit;
using Xunit.Abstractions;
//Issue #591
//When options class is only having explicit interface declarations, it should be detected as mutable.
namespace CommandLine.Tests.Unit
{
public class Issue591Tests
{
[Fact]
public void Parse_option_with_only_explicit_interface_implementation()
{
string actual = string.Empty;
var arguments = new[] { "--inputfile", "file2.txt" };
var result = Parser.Default.ParseArguments<Options_With_Only_Explicit_Interface>(arguments);
result.WithParsed(options => {
actual = ((IInterface_With_Two_Scalar_Options)options).InputFile;
});
actual.Should().Be("file2.txt");
}
}
}