public void WithEventsProcessorShouldValidateInput(JwtBearerOptions options,
                                                    IJwtBearerEvents eventsProcessor)
 {
     Assert.Throws <ArgumentNullException>(() => options.WithEventsProcessor(eventsProcessor));
 }
예제 #2
0
        public static JwtBearerOptions WithEventsProcessor(this JwtBearerOptions options, IJwtBearerEvents eventsProcessor)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (eventsProcessor == null)
            {
                throw new ArgumentNullException(nameof(eventsProcessor));
            }

            options.Events = eventsProcessor;
            return(options);
        }