File tree 1 file changed +29
-0
lines changed
tests/CommandLine.Tests/Unit
1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
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 Issue591ests
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
+ }
You can’t perform that action at this time.
0 commit comments