[Authorize] [HttpGet] [ActionName("FineOutcome")] [ProducesResponseType(typeof(Response), 200)] [ProducesResponseType(401)] public async Task<IActionResult> FineOutcome(string PCN, int ia) { //Code Action here }
var userMock = new Mock<IPrincipal>(); userMock.Setup(p => p.IsInRole("admin")).Returns(true); var contextMock = new Mock<HttpContext>(); contextMock.Setup(x => x.User ).Returns(new ClaimsPrincipal()); controller.ControllerContext.HttpContext = contextMock.Object; var outcome = controller.FineOutcome("513073/372796", 467);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)