private static RolesPermissionsHandler CreatePermissionHandler(params Role[] roles)
        {
            var roleManager = RolesMockHelper.MockRoleManager <IRole>();

            foreach (var role in roles)
            {
                roleManager.Setup(m => m.FindByNameAsync(role.RoleName)).ReturnsAsync(role);
            }

            var permissionGrantingService = new DefaultPermissionGrantingService();

            return(new RolesPermissionsHandler(roleManager.Object, permissionGrantingService));
        }
        private static PermissionHandler CreatePermissionHandler()
        {
            var permissionGrantingService = new DefaultPermissionGrantingService();

            return(new PermissionHandler(permissionGrantingService));
        }