DefaultAuthorizationServiceTests.cs (9)
845services.AddSingleton<IAuthorizationHandler>(new ExpenseReportAuthorizationHandler(new OperationAuthorizationRequirement[] { Operations.Edit }));
858Assert.True((await authorizationService.AuthorizeAsync(user, null, Operations.Edit)).Succeeded);
900Assert.False((await authorizationService.AuthorizeAsync(user, 1, Operations.Edit)).Succeeded);
901Assert.True((await authorizationService.AuthorizeAsync(user, 2, Operations.Edit)).Succeeded);
922Assert.False((await authorizationService.AuthorizeAsync(user, 1, Operations.Edit)).Succeeded);
931services.AddSingleton<IAuthorizationHandler>(new ExpenseReportAuthorizationHandler(new OperationAuthorizationRequirement[] { Operations.Edit }));
937Assert.True((await authorizationService.AuthorizeAsync(user, new ExpenseReport(), Operations.Edit)).Succeeded);
948services.AddSingleton<IAuthorizationHandler>(new ExpenseReportAuthorizationHandler(new OperationAuthorizationRequirement[] { Operations.Edit }));
954Assert.False((await authorizationService.AuthorizeAsync(user, null, Operations.Edit)).Succeeded);