Exemple #1
0
        public void TestExtendedCharactersContentLength()
        {
            var asciiWithExtendedCharacters = ExtendedCharactersFixture.AsciiWithExtendedCharacters();

            var response = Response.Of(ResponseStatus.Ok, Headers.Empty <ResponseHeader>(), asciiWithExtendedCharacters);

            var contentLength = int.Parse(response.HeaderValueOr(RequestHeader.ContentLength, "0"));

            Assert.False(contentLength == 0);

            Assert.True(asciiWithExtendedCharacters.Length < contentLength);

            Assert.Equal(Converters.TextToBytes(asciiWithExtendedCharacters).Length, contentLength);
        }
Exemple #2
0
        public void TestExtendedCharactersContentLength()
        {
            var asciiWithExtendedCharacters = ExtendedCharactersFixture.AsciiWithExtendedCharacters();

            var request =
                Request
                .Has(Method.Post)
                .WithUri("/one/two/")
                .WithHeader(RequestHeader.Host, "test.com")
                .WithBody(asciiWithExtendedCharacters);

            var contentLength = int.Parse(request.HeaderValueOr(RequestHeader.ContentLength, "0"));

            Assert.False(contentLength == 0);

            Assert.True(asciiWithExtendedCharacters.Length < contentLength);

            Assert.Equal(Converters.TextToBytes(asciiWithExtendedCharacters).Length, contentLength);
        }