-
Notifications
You must be signed in to change notification settings - Fork 480
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test to make sure parser can detect explicit interface implementa…
…tions
- Loading branch information
1 parent
2896eac
commit 924721e
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 Issue591ests | ||
{ | ||
[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"); | ||
} | ||
} | ||
} |