I'm using this resource authorization in my controller:
var result = await _authorizationService.AuthorizeAsync(User, document, operation);
I need to test my controller, and I need the authorization to pass in the test.
I tried:
_substituteAuthorizationService.AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), null, Arg.Any<IEnumerable<IAuthorizationRequirement>>())
.ReturnsForAnyArgs(new AuthorizationResult(......));
but I can't new an AuthorizationResult because it doesn't have a public constructor.
Any ideas? Thanks!
AuthorzationResult.Success()