@@ -3,6 +3,7 @@ namespace ReflectionAnalyzers.Tests.Documentation
33 using System ;
44 using System . Collections . Generic ;
55 using System . Diagnostics ;
6+ using System . Globalization ;
67 using System . IO ;
78 using System . Linq ;
89 using System . Text ;
@@ -13,7 +14,7 @@ namespace ReflectionAnalyzers.Tests.Documentation
1314 using NUnit . Framework ;
1415 using ReflectionAnalyzers ;
1516
16- public class Tests
17+ internal class Tests
1718 {
1819 private static readonly IReadOnlyList < DiagnosticAnalyzer > Analyzers = typeof ( AnalyzerCategory )
1920 . Assembly
@@ -65,11 +66,11 @@ public void Description(DescriptorInfo descriptorInfo)
6566 {
6667 var expected = descriptorInfo . Descriptor
6768 . Description
68- . ToString ( )
69+ . ToString ( CultureInfo . InvariantCulture )
6970 . Split ( new [ ] { "\r \n " } , StringSplitOptions . RemoveEmptyEntries )
7071 . First ( ) ;
7172 var actual = File . ReadLines ( descriptorInfo . DocFileName )
72- . SkipWhile ( l => ! l . StartsWith ( "## Description" ) )
73+ . SkipWhile ( l => ! l . StartsWith ( "## Description" , StringComparison . OrdinalIgnoreCase ) )
7374 . Skip ( 1 )
7475 . FirstOrDefault ( l => ! string . IsNullOrWhiteSpace ( l ) )
7576 ? . Replace ( "`" , string . Empty ) ;
@@ -130,12 +131,12 @@ private static string CreateStub(DescriptorInfo descriptorInfo)
130131 var descriptor = descriptorInfo . Descriptor ;
131132 var stub = Properties . Resources . DiagnosticDocTemplate
132133 . AssertReplace ( "{ID}" , descriptor . Id )
133- . AssertReplace ( "## ADD TITLE HERE" , $ "## { descriptor . Title . ToString ( ) } ")
134+ . AssertReplace ( "## ADD TITLE HERE" , $ "## { descriptor . Title . ToString ( CultureInfo . InvariantCulture ) } ")
134135 . AssertReplace ( "{SEVERITY}" , descriptor . DefaultSeverity . ToString ( ) )
135136 . AssertReplace ( "{ENABLED}" , descriptor . IsEnabledByDefault ? "true" : "false" )
136137 . AssertReplace ( "{CATEGORY}" , descriptor . Category )
137- . AssertReplace ( "ADD DESCRIPTION HERE" , descriptor . Description . ToString ( ) )
138- . AssertReplace ( "{TITLE}" , descriptor . Title . ToString ( ) ) ;
138+ . AssertReplace ( "ADD DESCRIPTION HERE" , descriptor . Description . ToString ( CultureInfo . InvariantCulture ) )
139+ . AssertReplace ( "{TITLE}" , descriptor . Title . ToString ( CultureInfo . InvariantCulture ) ) ;
139140 if ( Analyzers . Count ( x => x . SupportedDiagnostics . Any ( d => d . Id == descriptor . Id ) ) == 1 )
140141 {
141142 return stub . AssertReplace ( "{TYPENAME}" , descriptorInfo . Analyzer . GetType ( ) . Name )
@@ -191,11 +192,6 @@ private DescriptorInfo(DiagnosticAnalyzer analyzer, DiagnosticDescriptor descrip
191192 this . Analyzer = analyzer ;
192193 this . Descriptor = descriptor ;
193194 this . DocFileName = Path . Combine ( DocumentsDirectory . FullName , descriptor . Id + ".md" ) ;
194- this . CodeFileName = Directory . EnumerateFiles (
195- SolutionDirectory . FullName ,
196- analyzer . GetType ( ) . Name + ".cs" ,
197- SearchOption . AllDirectories )
198- . FirstOrDefault ( ) ;
199195 this . CodeFileUri = GetCodeFileUri ( analyzer ) ;
200196 }
201197
@@ -207,8 +203,6 @@ private DescriptorInfo(DiagnosticAnalyzer analyzer, DiagnosticDescriptor descrip
207203
208204 public string DocFileName { get ; }
209205
210- public string CodeFileName { get ; }
211-
212206 public string CodeFileUri { get ; }
213207
214208 public static string GetCodeFileUri ( DiagnosticAnalyzer analyzer )
0 commit comments