@@ -49,10 +49,9 @@ public void Report_when_no_errors_writes_nothing_to_console_hack()
49
49
}
50
50
51
51
[ Theory ]
52
- [ InlineData ( "-v" , false ) ]
53
- [ InlineData ( "-x" , true ) ]
54
- [ InlineData ( "" , false ) ]
55
- public void GetIsActivated_tests ( string input , bool result )
52
+ [ InlineData ( "-x" ) ]
53
+ [ InlineData ( "-non_existant_option" ) ]
54
+ public void GetIsActivated_GivenInvalidInput_SubsystemIsActive ( string input )
56
55
{
57
56
var rootCommand = new CliRootCommand { new CliOption < bool > ( "-v" ) } ;
58
57
var configuration = new CliConfiguration ( rootCommand ) ;
@@ -63,6 +62,23 @@ public void GetIsActivated_tests(string input, bool result)
63
62
var parseResult = CliParser . Parse ( rootCommand , input , configuration ) ;
64
63
var isActive = Subsystem . GetIsActivated ( errorSubsystem , parseResult ) ;
65
64
66
- isActive . Should ( ) . Be ( result ) ;
65
+ isActive . Should ( ) . BeTrue ( ) ;
66
+ }
67
+
68
+ [ Theory ]
69
+ [ InlineData ( "-v" ) ]
70
+ [ InlineData ( "" ) ]
71
+ public void GetIsActivated_GivenValidInput_SubsystemShouldNotBeActive ( string input )
72
+ {
73
+ var rootCommand = new CliRootCommand { new CliOption < bool > ( "-v" ) } ;
74
+ var configuration = new CliConfiguration ( rootCommand ) ;
75
+ var errorSubsystem = new ErrorReportingSubsystem ( ) ;
76
+ IReadOnlyList < string > args = [ "" ] ;
77
+ Subsystem . Initialize ( errorSubsystem , configuration , args ) ;
78
+
79
+ var parseResult = CliParser . Parse ( rootCommand , input , configuration ) ;
80
+ var isActive = Subsystem . GetIsActivated ( errorSubsystem , parseResult ) ;
81
+
82
+ isActive . Should ( ) . BeFalse ( ) ;
67
83
}
68
84
}
0 commit comments