@@ -579,8 +579,14 @@ public void AutoBuild_when_no_assembly_attributes()
579579
580580 ParserResult < Simple_Options > fakeResult = new NotParsed < Simple_Options > (
581581 TypeInfo . Create ( typeof ( Simple_Options ) ) , new Error [ 0 ] ) ;
582- HelpText actualResult = HelpText . AutoBuild ( fakeResult , ht => ht , ex => ex ) ;
582+ bool onErrorCalled = false ;
583+ HelpText actualResult = HelpText . AutoBuild ( fakeResult , ht =>
584+ {
585+ onErrorCalled = true ;
586+ return ht ;
587+ } , ex => ex ) ;
583588
589+ onErrorCalled . Should ( ) . BeTrue ( ) ;
584590 actualResult . Copyright . Should ( ) . Be ( expectedCopyright ) ;
585591 }
586592 finally
@@ -605,8 +611,14 @@ public void AutoBuild_with_assembly_title_and_version_attributes_only()
605611
606612 ParserResult < Simple_Options > fakeResult = new NotParsed < Simple_Options > (
607613 TypeInfo . Create ( typeof ( Simple_Options ) ) , new Error [ 0 ] ) ;
608- HelpText actualResult = HelpText . AutoBuild ( fakeResult , ht => ht , ex => ex ) ;
614+ bool onErrorCalled = false ;
615+ HelpText actualResult = HelpText . AutoBuild ( fakeResult , ht =>
616+ {
617+ onErrorCalled = true ;
618+ return ht ;
619+ } , ex => ex ) ;
609620
621+ onErrorCalled . Should ( ) . BeTrue ( ) ;
610622 actualResult . Heading . Should ( ) . Be ( string . Format ( "{0} {1}" , expectedTitle , expectedVersion ) ) ;
611623 }
612624 finally
@@ -630,8 +642,14 @@ public void AutoBuild_with_assembly_company_attribute_only()
630642
631643 ParserResult < Simple_Options > fakeResult = new NotParsed < Simple_Options > (
632644 TypeInfo . Create ( typeof ( Simple_Options ) ) , new Error [ 0 ] ) ;
633- HelpText actualResult = HelpText . AutoBuild ( fakeResult , ht => ht , ex => ex ) ;
645+ bool onErrorCalled = false ;
646+ HelpText actualResult = HelpText . AutoBuild ( fakeResult , ht =>
647+ {
648+ onErrorCalled = true ;
649+ return ht ;
650+ } , ex => ex ) ;
634651
652+ onErrorCalled . Should ( ) . BeFalse ( ) ; // Other attributes have fallback logic
635653 actualResult . Copyright . Should ( ) . Be ( string . Format ( "Copyright (C) {0} {1}" , DateTime . Now . Year , expectedCompany ) ) ;
636654 }
637655 finally
0 commit comments