@@ -14,11 +14,21 @@ namespace Templates.Test
1414{
1515 public class ByteOrderMarkTest : LoggedTest
1616 {
17- private readonly ITestOutputHelper _output ;
17+ private ITestOutputHelper _output ;
18+ public ITestOutputHelper Output
19+ {
20+ get
21+ {
22+ if ( _output == null )
23+ {
24+ _output = new TestOutputLogger ( Logger ) ;
25+ }
26+ return _output ;
27+ }
28+ }
1829
1930 public ByteOrderMarkTest ( )
2031 {
21- _output = new TestOutputLogger ( Logger ) ;
2232 }
2333
2434 [ Theory ]
@@ -45,13 +55,13 @@ public void JSAndJSONInAllTemplates_ShouldNotContainBOM(string projectName)
4555 // Check for UTF8 BOM 0xEF,0xBB,0xBF
4656 if ( bytes [ 0 ] == 0xEF && bytes [ 1 ] == 0xBB && bytes [ 2 ] == 0xBF )
4757 {
48- _output . WriteLine ( $ "File { filePath } has UTF-8 BOM characters.") ;
58+ Output . WriteLine ( $ "File { filePath } has UTF-8 BOM characters.") ;
4959 filesWithBOMCharactersPresent = true ;
5060 }
5161 // Check for UTF16 BOM 0xFF, 0xFE
5262 if ( bytes [ 0 ] == 0xFF && bytes [ 1 ] == 0xFE )
5363 {
54- _output . WriteLine ( $ "File { filePath } has UTF-16 BOM characters.") ;
64+ Output . WriteLine ( $ "File { filePath } has UTF-16 BOM characters.") ;
5565 filesWithBOMCharactersPresent = true ;
5666 }
5767 }
@@ -85,7 +95,7 @@ public void RazorFilesInWebProjects_ShouldContainBOM(string projectName)
8595 var expectedBytes = Encoding . UTF8 . GetPreamble ( ) ;
8696 if ( bytes [ 0 ] != expectedBytes [ 0 ] || bytes [ 1 ] != expectedBytes [ 1 ] || bytes [ 2 ] != expectedBytes [ 2 ] )
8797 {
88- _output . WriteLine ( $ "File { filePath } does not have UTF-8 BOM characters.") ;
98+ Output . WriteLine ( $ "File { filePath } does not have UTF-8 BOM characters.") ;
8999 nonBOMFilesPresent = true ;
90100 }
91101 }
0 commit comments