File tree Expand file tree Collapse file tree
TestStack.BDDfy/Reporters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,9 +38,12 @@ private static void ReportStoryHeader(Story story)
3838 return ;
3939
4040 Console . WriteLine ( "Story: " + story . Metadata . Title ) ;
41- Console . WriteLine ( "\t " + story . Metadata . Narrative1 ) ;
42- Console . WriteLine ( "\t " + story . Metadata . Narrative2 ) ;
43- Console . WriteLine ( "\t " + story . Metadata . Narrative3 ) ;
41+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative1 ) )
42+ Console . WriteLine ( "\t " + story . Metadata . Narrative1 ) ;
43+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative2 ) )
44+ Console . WriteLine ( "\t " + story . Metadata . Narrative2 ) ;
45+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative3 ) )
46+ Console . WriteLine ( "\t " + story . Metadata . Narrative3 ) ;
4447 }
4548
4649 static string PrefixWithSpaceIfRequired ( Step step )
Original file line number Diff line number Diff line change @@ -232,9 +232,12 @@ private void AddStoryMetadataAndNarrative(Story story)
232232 {
233233 using ( OpenTag ( "<ul class='storyNarrative'>" , HtmlTag . ul ) )
234234 {
235- AddLine ( string . Format ( "<li>{0}</li>" , story . Metadata . Narrative1 ) ) ;
236- AddLine ( string . Format ( "<li>{0}</li>" , story . Metadata . Narrative2 ) ) ;
237- AddLine ( string . Format ( "<li>{0}</li>" , story . Metadata . Narrative3 ) ) ;
235+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative1 ) )
236+ AddLine ( string . Format ( "<li>{0}</li>" , story . Metadata . Narrative1 ) ) ;
237+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative2 ) )
238+ AddLine ( string . Format ( "<li>{0}</li>" , story . Metadata . Narrative2 ) ) ;
239+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative3 ) )
240+ AddLine ( string . Format ( "<li>{0}</li>" , story . Metadata . Narrative3 ) ) ;
238241 }
239242 }
240243 }
Original file line number Diff line number Diff line change @@ -13,9 +13,12 @@ public string CreateReport(FileReportModel model)
1313 if ( story . Metadata != null )
1414 {
1515 report . AppendLine ( string . Format ( "## Story: {0}" , story . Metadata . Title ) ) ;
16- report . AppendLine ( string . Format ( " **{0}** " , story . Metadata . Narrative1 ) ) ;
17- report . AppendLine ( string . Format ( " **{0}** " , story . Metadata . Narrative2 ) ) ;
18- report . AppendLine ( string . Format ( " **{0}** " , story . Metadata . Narrative3 ) ) ;
16+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative1 ) )
17+ report . AppendLine ( string . Format ( " **{0}** " , story . Metadata . Narrative1 ) ) ;
18+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative2 ) )
19+ report . AppendLine ( string . Format ( " **{0}** " , story . Metadata . Narrative2 ) ) ;
20+ if ( ! string . IsNullOrEmpty ( story . Metadata . Narrative3 ) )
21+ report . AppendLine ( string . Format ( " **{0}** " , story . Metadata . Narrative3 ) ) ;
1922 }
2023
2124 report . AppendLine ( ) ; // separator
You can’t perform that action at this time.
0 commit comments