Skip to content

Commit

Permalink
Add UT for raised issue in razor generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-marichal committed Sep 8, 2023
1 parent 445e668 commit ca0c80e
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,26 @@ private static int RaiseHere()
.Verify();
}

[TestMethod]
public void RaisedIssue_WithinRazorGeneratedCode_ShouldNotBeReported()
{
using var scope = new EnvironmentVariableScope(false) { EnableRazorAnalysis = true };
new VerifierBuilder()
.AddAnalyzer(() => new DummyAnalyzerCS())
.AddSnippet(@"<p>Some Html</p>", "SomeFile.razor")
.VerifyNoIssueReported();
}

[TestMethod]
public void RaisedIssue_WithinCshtmlGeneratedCode_ShouldNotBeReported()
{
using var scope = new EnvironmentVariableScope(false) { EnableRazorAnalysis = true };
new VerifierBuilder()
.AddAnalyzer(() => new DummyAnalyzerCS())
.AddSnippet(@"<p>Some Html</p>", "SomeFile.cshtml")
.VerifyNoIssueReported();
}

private static string Snippet(string extension)
{
var keyword = extension == "razor" ? "code" : "functions";
Expand Down

0 comments on commit ca0c80e

Please sign in to comment.