Skip to content

Commit 347cf02

Browse files
committed
Add tests for -h and -V shortnames
The tests were already written, but the AutoHelpShortName and AutoVersionShortName parts were commented out because otherwise the tests wouldn't compile. Now the tests compile, and pass.
1 parent f2a8f5e commit 347cf02

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tests/CommandLine.Tests/Unit/AutoHelpTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void Explicit_help_command_with_valid_args_and_short_option_produces_just
128128
var help = new StringWriter();
129129
var sut = new Parser(config => {
130130
config.AutoHelp = true;
131-
// config.AutoHelpShortName = true; // Not implemented yet
131+
config.AutoHelpShortName = true;
132132
config.HelpWriter = help;
133133
});
134134

@@ -172,7 +172,7 @@ public void Explicit_help_command_with_invalid_args_and_short_option_produces_ju
172172
var help = new StringWriter();
173173
var sut = new Parser(config => {
174174
config.AutoHelp = true;
175-
// config.AutoHelpShortName = true; // Not implemented yet
175+
config.AutoHelpShortName = true;
176176
config.HelpWriter = help;
177177
});
178178

@@ -221,7 +221,7 @@ public void Dash_dash_help_in_a_string_value_with_short_option_does_not_produce_
221221
var help = new StringWriter();
222222
var sut = new Parser(config => {
223223
config.AutoHelp = true;
224-
// config.AutoHelpShortName = true; // Not implemented yet
224+
config.AutoHelpShortName = true;
225225
config.HelpWriter = help;
226226
});
227227

@@ -250,7 +250,7 @@ public void Dash_dash_help_in_a_string_value_with_short_option_in_data_does_not_
250250
var help = new StringWriter();
251251
var sut = new Parser(config => {
252252
config.AutoHelp = true;
253-
// config.AutoHelpShortName = true; // Not implemented yet
253+
config.AutoHelpShortName = true;
254254
config.HelpWriter = help;
255255
});
256256

@@ -299,7 +299,7 @@ public void Explicit_short_help_command_mixed_with_some_consumed_args_produces_j
299299
var help = new StringWriter();
300300
var sut = new Parser(config => {
301301
config.AutoHelp = true;
302-
// config.AutoHelpShortName = true; // Not implemented yet
302+
config.AutoHelpShortName = true;
303303
config.HelpWriter = help;
304304
});
305305

@@ -343,7 +343,7 @@ public void Dash_h_consumed_by_valid_args_with_invalid_args_produces_no_HelpRequ
343343
var help = new StringWriter();
344344
var sut = new Parser(config => {
345345
config.AutoHelp = true;
346-
// config.AutoHelpShortName = true; // Not implemented yet
346+
config.AutoHelpShortName = true;
347347
config.HelpWriter = help;
348348
});
349349

tests/CommandLine.Tests/Unit/AutoVersionTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void Explicit_version_command_with_valid_args_and_short_option_produces_j
128128
var help = new StringWriter();
129129
var sut = new Parser(config => {
130130
config.AutoVersion = true;
131-
// config.AutoVersionShortName = true; // Not implemented yet
131+
config.AutoVersionShortName = true;
132132
config.HelpWriter = help;
133133
});
134134

@@ -172,7 +172,7 @@ public void Explicit_version_command_with_invalid_args_and_short_option_produces
172172
var help = new StringWriter();
173173
var sut = new Parser(config => {
174174
config.AutoVersion = true;
175-
// config.AutoVersionShortName = true; // Not implemented yet
175+
config.AutoVersionShortName = true;
176176
config.HelpWriter = help;
177177
});
178178

@@ -221,7 +221,7 @@ public void Dash_dash_help_in_a_string_value_with_short_option_does_not_produce_
221221
var help = new StringWriter();
222222
var sut = new Parser(config => {
223223
config.AutoVersion = true;
224-
// config.AutoVersionShortName = true; // Not implemented yet
224+
config.AutoVersionShortName = true;
225225
config.HelpWriter = help;
226226
});
227227

@@ -250,7 +250,7 @@ public void Dash_dash_help_in_a_string_value_with_short_option_in_data_does_not_
250250
var help = new StringWriter();
251251
var sut = new Parser(config => {
252252
config.AutoVersion = true;
253-
// config.AutoVersionShortName = true; // Not implemented yet
253+
config.AutoVersionShortName = true;
254254
config.HelpWriter = help;
255255
});
256256

@@ -299,7 +299,7 @@ public void Explicit_short_version_command_mixed_with_some_consumed_args_produce
299299
var help = new StringWriter();
300300
var sut = new Parser(config => {
301301
config.AutoVersion = true;
302-
// config.AutoVersionShortName = true; // Not implemented yet
302+
config.AutoVersionShortName = true;
303303
config.HelpWriter = help;
304304
});
305305

@@ -343,7 +343,7 @@ public void Dash_h_consumed_by_valid_args_with_invalid_args_produces_no_VersionR
343343
var help = new StringWriter();
344344
var sut = new Parser(config => {
345345
config.AutoVersion = true;
346-
// config.AutoVersionShortName = true; // Not implemented yet
346+
config.AutoVersionShortName = true;
347347
config.HelpWriter = help;
348348
});
349349

0 commit comments

Comments
 (0)