Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions tests/CommandLine.Tests/Unit/ParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,11 @@ public void Properly_formatted_help_screen_is_displayed_when_usage_is_defined_in
{
// Fixture setup
var help = new StringWriter();
var sut = new Parser(config => config.HelpWriter = help);
var sut = new Parser(config =>
{
config.HelpWriter = help;
config.MaximumDisplayWidth = 80;
});

// Exercize system
sut.ParseArguments<Add_Verb_With_Usage_Attribute, Commit_Verb_With_Usage_Attribute, Clone_Verb_With_Usage_Attribute>(
Expand Down Expand Up @@ -628,7 +632,11 @@ public void Specific_verb_help_screen_should_be_displayed_regardless_other_argum
{
// Fixture setup
var help = new StringWriter();
var sut = new Parser(config => config.HelpWriter = help);
var sut = new Parser(config =>
{
config.HelpWriter = help;
config.MaximumDisplayWidth = 80;
});

// Exercize system
sut.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb>(
Expand Down Expand Up @@ -698,7 +706,11 @@ public void Properly_formatted_help_screen_excludes_help_as_unknown_option()
{
// Fixture setup
var help = new StringWriter();
var sut = new Parser(config => config.HelpWriter = help);
var sut = new Parser(config =>
{
config.HelpWriter = help;
config.MaximumDisplayWidth = 80;
});

// Exercize system
sut.ParseArguments<Add_Verb, Commit_Verb, Clone_Verb>(
Expand Down
3 changes: 2 additions & 1 deletion tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void Create_instance_with_enum_options_enabled()
{
// Fixture setup
// Exercize system
var sut = new HelpText { AddDashesToOption = true, AddEnumValuesToHelpText = true }
var sut = new HelpText { AddDashesToOption = true, AddEnumValuesToHelpText = true, MaximumDisplayWidth = 80 }
.AddPreOptionsLine("pre-options")
.AddOptions(new NotParsed<Options_With_Enum_Having_HelpText>(TypeInfo.Create(typeof(Options_With_Enum_Having_HelpText)), Enumerable.Empty<Error>()))
.AddPostOptionsLine("post-options");
Expand Down Expand Up @@ -184,6 +184,7 @@ public void When_help_text_has_hidden_option_it_should_not_be_added_to_help_text
// Fixture setup
// Exercize system
var sut = new HelpText(new HeadingInfo("CommandLine.Tests.dll", "1.9.4.131"));
sut.MaximumDisplayWidth = 80;
sut.AddOptions(
new NotParsed<Simple_Options_With_HelpText_Set_To_Long_Description>(
TypeInfo.Create(typeof(Simple_Options_With_HelpText_Set_To_Long_Description)),
Expand Down