Beispiel #1
0
        public void The_http_extension_methods_can_be_composed_to_generate_the_http_message()
        {
            _formatter.WriteHttpStatusLine(GetUtf8EncodedString("1.1"), GetUtf8EncodedString("200"), GetUtf8EncodedString("OK"));
            _formatter.WriteHttpHeader(GetUtf8EncodedString("Connection"), GetUtf8EncodedString("close"));
            var httpHeaderBuffer = _formatter.WriteHttpHeader(GetUtf8EncodedString("Connection"), GetUtf8EncodedString("close"));

            _formatter.EndHttpHeaderSection();
            _formatter.WriteHttpBody(GetUtf8EncodedString(HttpBody));
            _formatter.AppendNewLine();
            _formatter.WriteHttpBody(GetUtf8EncodedString(HttpBody));

            httpHeaderBuffer.UpdateValue("open");

            var result = _formatter.Buffer;

            result.Should().ContainInOrder(_httpMessageInBytes);

            ManagedBufferPool <byte> .SharedByteBufferPool.ReturnBuffer(ref result);
        }