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

            // Then
            head.GetStringContentsFromResponse().ShouldBeEmpty();
        }
Esempio n. 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);
        }
Esempio n. 6
0
        public void Should_set_empty_content()
        {
            // Given, When
            var head = new HeadResponse(this.response);

            // Then
            head.GetStringContentsFromResponse().ShouldBeEmpty();
        }
Esempio n. 7
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);
        }
Esempio n. 8
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);
        }
Esempio n. 9
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);
        }
        private HeadResponse CreateHeadResponse()
        {
            var head = new HeadResponse(this.response);

            head.PreExecute(A.Dummy <NancyContext>());
            head.Contents(new MemoryStream());
            return(head);
        }
Esempio n. 11
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");
        }
Esempio n. 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");
 }
Esempio n. 13
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");
        }
Esempio n. 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");
        }