@@ -8,7 +8,7 @@ namespace TestStack.BDDfy.Reporters.MarkDown
88{
99 public class MarkDownReportBuilder : IReportBuilder
1010 {
11- private readonly List < Exception > _exceptions = new ( ) ;
11+ private readonly List < Exception > _exceptions = [ ] ;
1212
1313 public string CreateReport ( FileReportModel model )
1414 {
@@ -38,7 +38,7 @@ public string CreateReport(FileReportModel model)
3838 var exampleScenario = story . Scenarios . First ( ) ;
3939 report . AppendLine ( string . Format ( "### {0}" , exampleScenario . Title ) ) ;
4040
41- if ( exampleScenario . Steps . Any ( ) )
41+ if ( exampleScenario . Steps . Count != 0 )
4242 {
4343 foreach ( var step in exampleScenario . Steps . Where ( s => s . ShouldReport ) )
4444 report . AppendLine ( " " + WebUtility . HtmlEncode ( step . Title ) + " " ) ;
@@ -72,9 +72,9 @@ public string CreateReport(FileReportModel model)
7272 return report . ToString ( ) ;
7373 }
7474
75- private void ReportTags ( StringBuilder report , List < string > tags )
75+ private static void ReportTags ( StringBuilder report , List < string > tags )
7676 {
77- if ( ! tags . Any ( ) )
77+ if ( tags . Count == 0 )
7878 return ;
7979
8080 report . AppendLine ( string . Format ( "Tags: {0}" , string . Join ( ", " , tags . Select ( t => string . Format ( "`{0}`" , t ) ) ) ) ) ;
@@ -91,7 +91,7 @@ private void WriteExamples(StringBuilder report, ReportModel.Scenario exampleSce
9191 var maxWidth = new int [ numberColumns ] ;
9292 var rows = new List < string [ ] > ( ) ;
9393
94- Action < IEnumerable < string > , string , string > addRow = ( cells , result , error ) =>
94+ void addRow ( IEnumerable < string > cells , string result , string error )
9595 {
9696 var row = new string [ numberColumns ] ;
9797 var index = 0 ;
@@ -113,7 +113,7 @@ private void WriteExamples(StringBuilder report, ReportModel.Scenario exampleSce
113113 }
114114
115115 rows . Add ( row ) ;
116- } ;
116+ }
117117
118118 addRow ( exampleScenario . Example . Headers , "Result" , "Errors" ) ;
119119 foreach ( var scenario in scenarios )
@@ -130,7 +130,7 @@ private void WriteExamples(StringBuilder report, ReportModel.Scenario exampleSce
130130 WriteExampleRow ( report , row , maxWidth ) ;
131131 }
132132
133- private void WriteExampleRow ( StringBuilder report , string [ ] row , int [ ] maxWidth )
133+ private static void WriteExampleRow ( StringBuilder report , string [ ] row , int [ ] maxWidth )
134134 {
135135 report . Append ( " " ) ;
136136 for ( int index = 0 ; index < row . Length ; index ++ )
@@ -173,7 +173,7 @@ void ReportExceptions(StringBuilder report)
173173 else
174174 report . AppendLine ( ) ;
175175
176- var stackTrace = string . Join ( Environment . NewLine , exception . StackTrace . Split ( new [ ] { Environment . NewLine } , StringSplitOptions . None )
176+ var stackTrace = string . Join ( Environment . NewLine , exception . StackTrace . Split ( [ Environment . NewLine ] , StringSplitOptions . None )
177177 . Select ( s => " " + s ) ) ;
178178 report . AppendLine ( stackTrace ) ;
179179 }
@@ -185,7 +185,7 @@ static string FlattenExceptionMessage(string message)
185185 {
186186 return string . Join ( " " , message
187187 . Replace ( "\t " , " " ) // replace tab with one space
188- . Split ( new [ ] { "\r \n " , "\n " } , StringSplitOptions . None )
188+ . Split ( [ "\r \n " , "\n " ] , StringSplitOptions . None )
189189 . Select ( s => s . Trim ( ) ) )
190190 . TrimEnd ( ',' ) ; // chop any , from the end
191191 }
0 commit comments