Exemplo n.º 1
0
 public void can_instantiate_with_status_and_body()
 {
     var response = new Response(404, "Didn't find this");
     response.Status.ShouldEqual(404);
     response.Body.ShouldEqual("Didn't find this");
     response.Headers.Should(Be.Empty);
 }
Exemplo n.º 2
0
 public void can_instantiate_with_status_and_headers()
 {
     var response = new Response(302, new Dictionary<string,string> {{"Location","/foo"}});
     response.Status.ShouldEqual(302);
     response.Body.ShouldEqual("");
     response.Headers.ShouldEqual(new Dictionary<string,string> {{"Location","/foo"}});
 }
Exemplo n.º 3
0
 public void can_instantiate_with_status()
 {
     var response = new Response(400);
     response.Status.ShouldEqual(400);
     response.Body.ShouldEqual("");
     response.Headers.Should(Be.Empty);
 }
Exemplo n.º 4
0
 public static Response FromHttpResponse(string httpResponseText)
 {
     var response = new Response();
     response.LoadHttpResponse(httpResponseText);
     return response;
 }