예제 #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);
 }
예제 #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"}});
 }
예제 #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);
 }
예제 #4
0
파일: Response.cs 프로젝트: guyzo/Requestor
 public static Response FromHttpResponse(string httpResponseText)
 {
     var response = new Response();
     response.LoadHttpResponse(httpResponseText);
     return response;
 }