I need to check the ModelState of controller method which has AUTHORIZE filter, because of that it is not accessible.
[Microsoft.AspNetCore.Mvc.Produces("application/json")]
[System.Web.Http.Authorize]
public Microsoft.AspNetCore.Mvc.ActionResult<HttpResponseMessage> CrowdSourcedData([FromBody] List<Apps> Apps)
{
if (!ModelState.IsValid)
{
return null;
}
return _dataProcessor.CrowdSourcedData(Apps);
}
How can I unit test this method, I have tried other given options but nothing worked and I don't want to do Integration testing.