DotNetAnalyzers / AspNetCoreAnalyzers

MIT License
62 stars 4 forks source link

ASP011 when more than one attribute #54

Closed JohanLarsson closed 5 years ago

JohanLarsson commented 5 years ago
        [Test]
        public void WhenSeparateAttributes()
        {
            var code = @"
namespace AspBox
{
    using Microsoft.AspNetCore.Mvc;

    [Route(""api/values/{↓id}"")]
    [ApiController]
    public class OrdersController : Controller
    {
        [HttpGet(""items/{↓id}"")]
        public IActionResult GetId(string id)
        {
            return this.Ok(id);
        }
    }
}";

            AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic, code);
        }