Example #1
0
        public Task HandleCorsRequestAsync_NullContext_Throws()
        {
            CorsMessageHandler corsHandler = new CorsMessageHandler(new HttpConfiguration());

            return(Assert.ThrowsArgumentNullAsync(
                       () => corsHandler.HandleCorsRequestAsync(new HttpRequestMessage(), null, CancellationToken.None),
                       "corsRequestContext"));
        }
Example #2
0
        public void HandleCorsRequestAsync_NullContext_Throws()
        {
            CorsMessageHandler corsHandler = new CorsMessageHandler(new HttpConfiguration());

            Assert.ThrowsArgumentNull(() =>
            {
                HttpResponseMessage response = corsHandler.HandleCorsRequestAsync(new HttpRequestMessage(), null, CancellationToken.None).Result;
            },
                                      "corsRequestContext");
        }
 public void HandleCorsRequestAsync_NullContext_Throws()
 {
     CorsMessageHandler corsHandler = new CorsMessageHandler(new HttpConfiguration());
     Assert.ThrowsArgumentNull(() =>
     {
         HttpResponseMessage response = corsHandler.HandleCorsRequestAsync(new HttpRequestMessage(), null, CancellationToken.None).Result;
     },
     "corsRequestContext");
 }