private HeadResponse CreateHeadResponse()
 {
     var head = new HeadResponse(this.response);
     head.PreExecute(A.Dummy<NancyContext>());
     head.Contents(new MemoryStream());
     return head;
 }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        public void Should_set_empty_content()
        {
            // Given, When
            var head = new HeadResponse(this.response);

            // Then
            head.GetStringContentsFromResponse().ShouldBeEmpty();
        }
Exemple #5
0
        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);
        }
        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);
        }
        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_status_property_to_that_of_decorated_response()
        {
            // Given, When
            var head = new HeadResponse(this.response);

            // Then
            head.StatusCode.ShouldEqual(this.response.StatusCode);
        }
        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");
        }
Exemple #12
0
 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");
        }
Exemple #14
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");
        }