Open
Description
[Test]
public void WhenRouteOnClass()
{
var code = @"
namespace AspBox
{
using Microsoft.AspNetCore.Mvc;
[Route(""api/values/{id}"")]
[ApiController]
public class OrdersController : Controller
{
[HttpGet]
public IActionResult GetValue(int ↓wrong)
{
return this.Ok(wrong);
}
}
}";
var fixedCode = @"
namespace AspBox
{
using Microsoft.AspNetCore.Mvc;
[Route(""api/values/{id}"")]
[ApiController]
public class OrdersController : Controller
{
[HttpGet]
public IActionResult GetValue(int id)
{
return this.Ok(id);
}
}
}";
AnalyzerAssert.CodeFix(Analyzer, Fix, ExpectedDiagnostic, code, fixedCode);
}
Metadata
Metadata
Assignees
Labels
No labels