Example #1
0
        public void get_header_value()
        {
            theRecordedOutput.GetHeaderValue(HttpResponseHeaders.ETag).ShouldBeNull();

            theRecordedOutput.AppendHeader(HttpResponseHeaders.ETag, "12345");

            theRecordedOutput.GetHeaderValue(HttpResponseHeaders.ETag).ShouldEqual("12345");
        }
Example #2
0
        public void get_headers()
        {
            theRecordedOutput.AppendHeader("a", "1");
            theRecordedOutput.AppendHeader("b", "2");
            theRecordedOutput.AppendHeader("c", "3");

            theRecordedOutput.Write("stuff");
            theRecordedOutput.Write("more stuff");
            theRecordedOutput.Write("other stuff");

            theRecordedOutput.Headers().ShouldHaveTheSameElementsAs(new Header("a", "1"), new Header("b", "2"), new Header("c", "3"));
        }
        private IRecordedOutput getOutputWithEtag(string etag)
        {
            var output = new RecordedOutput(null);

            output.AppendHeader(HttpResponseHeaders.ETag, etag);

            return(output);
        }