File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.Test/SpecialRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,19 @@ public async Task TestInvalidSettingsAsync()
5858 await this . VerifyCSharpDiagnosticAsync ( TestCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
5959 }
6060
61+ [ Fact ]
62+ public async Task TestEmptySettingsAsync ( )
63+ {
64+ // The test infrastructure will not add a settings file to the compilation if GetSettings returns null or an empty string.
65+ // This is why we set settings to a simple whitespace character.
66+ this . settings = " " ;
67+
68+ // This diagnostic is reported without a location
69+ DiagnosticResult expected = this . CSharpDiagnostic ( ) ;
70+
71+ await this . VerifyCSharpDiagnosticAsync ( TestCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
72+ }
73+
6174 /// <inheritdoc/>
6275 protected override string GetSettings ( )
6376 {
You can’t perform that action at this time.
0 commit comments