コード例 #1
0
 public static Nancy.Testing.BrowserResponse Delete(this Nancy.Testing.Browser browser, string route)
 {
     return(browser.Delete(route, with =>
     {
         with.HttpRequest();
     }));
 }
コード例 #2
0
 public static Nancy.Testing.BrowserResponse Get(this Nancy.Testing.Browser browser, string route)
 {
     return(browser.Get(route, with =>
     {
         with.HttpRequest();
         with.Header("accept", "application/json");
     }));
 }
コード例 #3
0
 public static Nancy.Testing.BrowserResponse Post(this Nancy.Testing.Browser browser, string route, string bodyContent)
 {
     return(browser.Post(route, with =>
     {
         with.HttpRequest();
         with.Header("accept", "application/json");
         with.Header("Content-Type", "application/json");
         with.Body(bodyContent);
     }));
 }
コード例 #4
0
 public void Hello_world_route_should_return_httpstatus_200()
 {
     var browser = new Nancy.Testing.Browser(new Nancy.DefaultNancyBootstrapper());
     var response = browser.Get("/1", (with) => with.HttpRequest());
     Assert.Equal(HttpStatusCode.OK, response.StatusCode);
 }