File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ namespace CommandLine . Tests . Fakes
2+ {
3+ public class HelpTextWithMixedLineBreaks_Options
4+ {
5+ [ Option ( HelpText =
6+ "This is a help text description\n It has multiple lines.\r \n Third line" ) ]
7+ public string StringValue { get ; set ; }
8+ }
9+ }
Original file line number Diff line number Diff line change @@ -718,5 +718,24 @@ public void HelpTextPreservesIndentationAcrossWordWrap()
718718 }
719719
720720
721+ [ Fact ]
722+ public void HelpTextIsConsitentRegardlessOfCompileTimeLineStyle ( )
723+ {
724+ // Fixture setup
725+ // Exercize system
726+ var sut = new HelpText { AddDashesToOption = true }
727+ . AddOptions ( new NotParsed < Simple_Options > ( TypeInfo . Create ( typeof ( HelpTextWithMixedLineBreaks_Options ) ) ,
728+ Enumerable . Empty < Error > ( ) ) ) ;
729+
730+ // Verify outcome
731+
732+ var lines = sut . ToString ( ) . ToNotEmptyLines ( ) ;
733+ lines [ 0 ] . Should ( ) . BeEquivalentTo ( " --stringvalue This is a help text description" ) ;
734+ lines [ 1 ] . Should ( ) . BeEquivalentTo ( " It has multiple lines." ) ;
735+ lines [ 2 ] . Should ( ) . BeEquivalentTo ( " Third line" ) ;
736+
737+ // Teardown
738+ }
739+
721740 }
722741}
You can’t perform that action at this time.
0 commit comments