Skip to content

Commit

Permalink
S6967: Add FP repro for #9261 (#9286)
Browse files Browse the repository at this point in the history
  • Loading branch information
mary-georgiou-sonarsource committed May 16, 2024
1 parent 6f55663 commit 761e070
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class CallModelStateIsValidTest

[TestMethod]
public void CallModelStateIsValid_CS() =>
builder.AddPaths("CallModelStateIsValid.cs").Verify();
builder.AddPaths("CallModelStateIsValid.cs", "CallModelStateIsValid.AutogeneratedController.cs").Verify();

[TestMethod]
public void CallModelStateIsValid_AssemblyLevelControllerAttribute_CS() =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Repro https://github.com/SonarSource/sonar-dotnet/issues/9260
// Also related to https://github.com/SonarSource/sonar-dotnet/issues/8876
using Microsoft.AspNetCore.Mvc;

public partial class AutogeneratedController : Controller
{
// Repro for https://github.com/SonarSource/sonar-dotnet/issues/9261
// this will be fixed once https://github.com/SonarSource/sonar-dotnet/issues/8876 is fixed
[HttpPost]
public void Post(object model) { } // Noncompliant, FP we should not raise in autogenerated code.
}

0 comments on commit 761e070

Please sign in to comment.