@@ -4,11 +4,17 @@ public sealed partial class CommandAppTests
44{
55 public sealed class Version
66 {
7- [ Fact ]
8- public void Should_Output_CLI_Version_To_The_Console ( )
7+ [ Theory ]
8+ [ InlineData ( false ) ]
9+ [ InlineData ( true ) ]
10+ public void Should_Output_CLI_Version_To_The_Console ( bool strictParsing )
911 {
1012 // Given
1113 var fixture = new CommandAppTester ( ) ;
14+ fixture . Configure ( configurator =>
15+ {
16+ configurator . Settings . StrictParsing = strictParsing ;
17+ } ) ;
1218
1319 // When
1420 var result = fixture . Run ( Constants . VersionCommand ) ;
@@ -18,14 +24,17 @@ public void Should_Output_CLI_Version_To_The_Console()
1824 }
1925
2026 [ Theory ]
21- [ InlineData ( "-v" ) ]
22- [ InlineData ( "--version" ) ]
23- public void Should_Output_Application_Version_To_The_Console_With_No_Command ( string versionOption )
27+ [ InlineData ( "-v" , false ) ]
28+ [ InlineData ( "-v" , true ) ]
29+ [ InlineData ( "--version" , false ) ]
30+ [ InlineData ( "--version" , true ) ]
31+ public void Should_Output_Application_Version_To_The_Console_With_No_Command ( string versionOption , bool strictParsing )
2432 {
2533 // Given
2634 var fixture = new CommandAppTester ( ) ;
2735 fixture . Configure ( configurator =>
2836 {
37+ configurator . Settings . StrictParsing = strictParsing ;
2938 configurator . SetApplicationVersion ( "1.0" ) ;
3039 } ) ;
3140
@@ -37,12 +46,18 @@ public void Should_Output_Application_Version_To_The_Console_With_No_Command(str
3746 }
3847
3948 [ Theory ]
40- [ InlineData ( "-v" ) ]
41- [ InlineData ( "--version" ) ]
42- public void Should_Not_Display_Version_If_Not_Specified ( string versionOption )
49+ [ InlineData ( "-v" , false ) ]
50+ [ InlineData ( "-v" , true ) ]
51+ [ InlineData ( "--version" , false ) ]
52+ [ InlineData ( "--version" , true ) ]
53+ public void Should_Not_Display_Version_If_Not_Specified ( string versionOption , bool strictParsing )
4354 {
4455 // Given
4556 var fixture = new CommandAppTester ( ) ;
57+ fixture . Configure ( configurator =>
58+ {
59+ configurator . Settings . StrictParsing = strictParsing ;
60+ } ) ;
4661
4762 // When
4863 var result = fixture . Run ( versionOption ) ;
@@ -53,15 +68,18 @@ public void Should_Not_Display_Version_If_Not_Specified(string versionOption)
5368 }
5469
5570 [ Theory ]
56- [ InlineData ( "-v" ) ]
57- [ InlineData ( "--version" ) ]
58- public void Should_Output_Application_Version_To_The_Console_With_Default_Command ( string versionOption )
71+ [ InlineData ( "-v" , false ) ]
72+ [ InlineData ( "-v" , true ) ]
73+ [ InlineData ( "--version" , false ) ]
74+ [ InlineData ( "--version" , true ) ]
75+ public void Should_Output_Application_Version_To_The_Console_With_Default_Command ( string versionOption , bool strictParsing )
5976 {
6077 // Given
6178 var fixture = new CommandAppTester ( ) ;
6279 fixture . SetDefaultCommand < EmptyCommand > ( ) ;
6380 fixture . Configure ( configurator =>
6481 {
82+ configurator . Settings . StrictParsing = strictParsing ;
6583 configurator . SetApplicationVersion ( "1.0" ) ;
6684 } ) ;
6785
@@ -73,14 +91,17 @@ public void Should_Output_Application_Version_To_The_Console_With_Default_Comman
7391 }
7492
7593 [ Theory ]
76- [ InlineData ( "-v" ) ]
77- [ InlineData ( "--version" ) ]
78- public void Should_Execute_Command_Not_Output_Application_Version_To_The_Console ( string versionOption )
94+ [ InlineData ( "-v" , false ) ]
95+ [ InlineData ( "-v" , true ) ]
96+ [ InlineData ( "--version" , false ) ]
97+ [ InlineData ( "--version" , true ) ]
98+ public void Should_Execute_Command_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
7999 {
80100 // Given
81101 var fixture = new CommandAppTester ( ) ;
82102 fixture . Configure ( configurator =>
83103 {
104+ configurator . Settings . StrictParsing = strictParsing ;
84105 configurator . SetApplicationVersion ( "1.0" ) ;
85106 configurator . AddCommand < EmptyCommand > ( "empty" ) ;
86107 } ) ;
@@ -94,14 +115,17 @@ public void Should_Execute_Command_Not_Output_Application_Version_To_The_Console
94115 }
95116
96117 [ Theory ]
97- [ InlineData ( "-v" ) ]
98- [ InlineData ( "--version" ) ]
99- public void Should_Output_Application_Version_To_The_Console_With_Branch_Default_Command ( string versionOption )
118+ [ InlineData ( "-v" , false ) ]
119+ [ InlineData ( "-v" , true ) ]
120+ [ InlineData ( "--version" , false ) ]
121+ [ InlineData ( "--version" , true ) ]
122+ public void Should_Output_Application_Version_To_The_Console_With_Branch_Default_Command ( string versionOption , bool strictParsing )
100123 {
101124 // Given
102125 var fixture = new CommandAppTester ( ) ;
103126 fixture . Configure ( configurator =>
104127 {
128+ configurator . Settings . StrictParsing = strictParsing ;
105129 configurator . SetApplicationVersion ( "1.0" ) ;
106130 configurator . AddBranch < EmptyCommandSettings > ( "branch" , branch =>
107131 {
@@ -117,14 +141,17 @@ public void Should_Output_Application_Version_To_The_Console_With_Branch_Default
117141 }
118142
119143 [ Theory ]
120- [ InlineData ( "-v" ) ]
121- [ InlineData ( "--version" ) ]
122- public void Should_Execute_Branch_Default_Command_Not_Output_Application_Version_To_The_Console ( string versionOption )
144+ [ InlineData ( "-v" , false ) ]
145+ [ InlineData ( "-v" , true ) ]
146+ [ InlineData ( "--version" , false ) ]
147+ [ InlineData ( "--version" , true ) ]
148+ public void Should_Execute_Branch_Default_Command_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
123149 {
124150 // Given
125151 var fixture = new CommandAppTester ( ) ;
126152 fixture . Configure ( configurator =>
127153 {
154+ configurator . Settings . StrictParsing = strictParsing ;
128155 configurator . SetApplicationVersion ( "1.0" ) ;
129156 configurator . AddBranch < EmptyCommandSettings > ( "branch" , branch =>
130157 {
@@ -141,14 +168,17 @@ public void Should_Execute_Branch_Default_Command_Not_Output_Application_Version
141168 }
142169
143170 [ Theory ]
144- [ InlineData ( "-v" ) ]
145- [ InlineData ( "--version" ) ]
146- public void Should_Execute_Branch_Command_Not_Output_Application_Version_To_The_Console ( string versionOption )
171+ [ InlineData ( "-v" , false ) ]
172+ [ InlineData ( "-v" , true ) ]
173+ [ InlineData ( "--version" , false ) ]
174+ [ InlineData ( "--version" , true ) ]
175+ public void Should_Execute_Branch_Command_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
147176 {
148177 // Given
149178 var fixture = new CommandAppTester ( ) ;
150179 fixture . Configure ( configurator =>
151180 {
181+ configurator . Settings . StrictParsing = strictParsing ;
152182 configurator . SetApplicationVersion ( "1.0" ) ;
153183 configurator . AddBranch < EmptyCommandSettings > ( "branch" , branch =>
154184 {
@@ -169,15 +199,18 @@ public void Should_Execute_Branch_Command_Not_Output_Application_Version_To_The_
169199 /// then execute this command instead of displaying the explicitly set Application Version.
170200 /// </summary>
171201 [ Theory ]
172- [ InlineData ( "-v" ) ]
173- [ InlineData ( "--version" ) ]
174- public void Should_Execute_Default_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption )
202+ [ InlineData ( "-v" , false ) ]
203+ [ InlineData ( "-v" , true ) ]
204+ [ InlineData ( "--version" , false ) ]
205+ [ InlineData ( "--version" , true ) ]
206+ public void Should_Execute_Default_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
175207 {
176208 // Given
177209 var fixture = new CommandAppTester ( ) ;
178210 fixture . SetDefaultCommand < Spectre . Console . Tests . Data . VersionCommand > ( ) ;
179211 fixture . Configure ( configurator =>
180212 {
213+ configurator . Settings . StrictParsing = strictParsing ;
181214 configurator . SetApplicationVersion ( "1.0" ) ;
182215 } ) ;
183216
@@ -189,14 +222,17 @@ public void Should_Execute_Default_VersionCommand_Not_Output_Application_Version
189222 }
190223
191224 [ Theory ]
192- [ InlineData ( "-v" ) ]
193- [ InlineData ( "--version" ) ]
194- public void Should_Execute_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption )
225+ [ InlineData ( "-v" , false ) ]
226+ [ InlineData ( "-v" , true ) ]
227+ [ InlineData ( "--version" , false ) ]
228+ [ InlineData ( "--version" , true ) ]
229+ public void Should_Execute_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
195230 {
196231 // Given
197232 var fixture = new CommandAppTester ( ) ;
198233 fixture . Configure ( configurator =>
199234 {
235+ configurator . Settings . StrictParsing = strictParsing ;
200236 configurator . SetApplicationVersion ( "1.0" ) ;
201237 configurator . AddCommand < Spectre . Console . Tests . Data . VersionCommand > ( "hello" ) ;
202238 } ) ;
@@ -209,14 +245,17 @@ public void Should_Execute_VersionCommand_Not_Output_Application_Version_To_The_
209245 }
210246
211247 [ Theory ]
212- [ InlineData ( "-v" ) ]
213- [ InlineData ( "--version" ) ]
214- public void Should_Execute_Branch_Default_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption )
248+ [ InlineData ( "-v" , false ) ]
249+ [ InlineData ( "-v" , true ) ]
250+ [ InlineData ( "--version" , false ) ]
251+ [ InlineData ( "--version" , true ) ]
252+ public void Should_Execute_Branch_Default_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
215253 {
216254 // Given
217255 var fixture = new CommandAppTester ( ) ;
218256 fixture . Configure ( configurator =>
219257 {
258+ configurator . Settings . StrictParsing = strictParsing ;
220259 configurator . SetApplicationVersion ( "1.0" ) ;
221260 configurator . AddBranch < VersionSettings > ( "branch" , branch =>
222261 {
@@ -232,14 +271,17 @@ public void Should_Execute_Branch_Default_VersionCommand_Not_Output_Application_
232271 }
233272
234273 [ Theory ]
235- [ InlineData ( "-v" ) ]
236- [ InlineData ( "--version" ) ]
237- public void Should_Execute_Branch_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption )
274+ [ InlineData ( "-v" , false ) ]
275+ [ InlineData ( "-v" , true ) ]
276+ [ InlineData ( "--version" , false ) ]
277+ [ InlineData ( "--version" , true ) ]
278+ public void Should_Execute_Branch_VersionCommand_Not_Output_Application_Version_To_The_Console ( string versionOption , bool strictParsing )
238279 {
239280 // Given
240281 var fixture = new CommandAppTester ( ) ;
241282 fixture . Configure ( configurator =>
242283 {
284+ configurator . Settings . StrictParsing = strictParsing ;
243285 configurator . SetApplicationVersion ( "1.0" ) ;
244286 configurator . AddBranch < VersionSettings > ( "branch" , branch =>
245287 {
0 commit comments