Skip to content

Commit

Permalink
Add test verifying fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
333fred committed Nov 29, 2022
1 parent 1a7266a commit 37b5291
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,25 @@ private C() { }
await VerifyCSharpAsync(source, shippedText, unshippedText, $"[*]\r\n{editorconfigText}", expectedDiagnostics);
}

[Fact]
public async Task AnalyzerFilePresent_MissingNonEnabledText()
{
var source = $$"""
{{EnabledModifierCSharp}} class C
{
private C() { }
}
""";

string? shippedText = "";
string? unshippedText = "";

var expectedDiagnostics = new[] { GetCSharpResultAt(2, 8 + EnabledModifierCSharp.Length, DeclareNewApiRule, "C") };

await VerifyCSharpAsync(source, shippedText, unshippedText, $"[*]\r\ndotnet_public_api_analyzer.require_api_files = true", expectedDiagnostics);
}

[Fact]
public async Task EmptyPublicAPIFilesAsync()
{
Expand Down

0 comments on commit 37b5291

Please sign in to comment.