From 78900d2ae72f3292b0c38d2cfa9bd0faae63373d Mon Sep 17 00:00:00 2001 From: Branden Conley Date: Mon, 23 Apr 2018 14:19:10 -0600 Subject: [PATCH] Explicitly passing MaximumDisplayWidth = 80 to tests that fail unless your Maximum Display Width is 80 --- tests/CommandLine.Tests/Unit/ParserTests.cs | 18 +++++++++++++++--- .../Unit/Text/HelpTextTests.cs | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tests/CommandLine.Tests/Unit/ParserTests.cs b/tests/CommandLine.Tests/Unit/ParserTests.cs index 43b44e27..7bbf757d 100644 --- a/tests/CommandLine.Tests/Unit/ParserTests.cs +++ b/tests/CommandLine.Tests/Unit/ParserTests.cs @@ -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( @@ -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( @@ -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( diff --git a/tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs b/tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs index 90ca41b5..db0397fa 100644 --- a/tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs +++ b/tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs @@ -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(TypeInfo.Create(typeof(Options_With_Enum_Having_HelpText)), Enumerable.Empty())) .AddPostOptionsLine("post-options"); @@ -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( TypeInfo.Create(typeof(Simple_Options_With_HelpText_Set_To_Long_Description)),