I use this resource authorization in my controller:
var result = await _authorizationService.AuthorizeAsync(User, document, operation);
I need to check my controller, and I need to go through authorization to pass the test.
I tried:
_substituteAuthorizationService.AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), null, Arg.Any<IEnumerable<IAuthorizationRequirement>>()) .ReturnsForAnyArgs(new AuthorizationResult(......));
but I cannot create a new AuthorizationResult because it does not have a public constructor.
Any ideas? Thanks!
source share