private HeadResponse CreateHeadResponse() { var head = new HeadResponse(this.response); head.PreExecute(A.Dummy<NancyContext>()); head.Contents(new MemoryStream()); return head; }
public void Should_set_status_property_to_that_of_decorated_response() { // Given, When var head = new HeadResponse(this.response); // Then head.StatusCode.ShouldEqual(this.response.StatusCode); }
public void Should_set_headers_property_to_that_of_decorated_response() { // Given, When var head = new HeadResponse(this.response); // Then head.Headers.ShouldBeSameAs(this.headers); }
public void Should_set_empty_content() { // Given, When var head = new HeadResponse(this.response); // Then head.GetStringContentsFromResponse().ShouldBeEmpty(); }
public void Should_set_content_type_property_to_that_of_decorated_response() { // Given, When var head = new HeadResponse(this.response); // Then head.ContentType.ShouldEqual(this.response.ContentType); }
private HeadResponse CreateHeadResponse() { var head = new HeadResponse(this.response); head.PreExecute(A.Dummy <NancyContext>()); head.Contents(new MemoryStream()); return(head); }
public void Should_set_content_length() { // Given, When var head = new HeadResponse(this.response); // Then head.Headers.ContainsKey("Content-Length").ShouldBeTrue(); head.Headers["Content-Length"].ShouldNotEqual("0"); }
public void Should_not_overwrite_content_length() { // Given, When this.response.Headers.Add("Content-Length", "foo"); var head = new HeadResponse(this.response); // Then head.Headers.ContainsKey("Content-Length").ShouldBeTrue(); head.Headers["Content-Length"].ShouldEqual("foo"); }