public async Task no_errors_when_authenticated()
        {
            var req = new AuthenticatedUserRequirement();

            var context = new AuthorizationContext();

            context.User = CreatePrincipal("jwt");

            await req.Authorize(context);

            context.HasErrors.ShouldBeFalse();
        }
        public async Task produces_error_when_not_authenticated()
        {
            var req = new AuthenticatedUserRequirement();

            var context = new AuthorizationContext();

            context.User = CreatePrincipal();

            await req.Authorize(context);

            context.HasErrors.ShouldBeTrue();
            context.Errors.Single().ShouldBe("An authenticated user is required.");
        }