public async Task LZ4MessagePackFormatter()
        {
            var person = new User
            {
                UserId      = 1,
                FullName    = "John Denver",
                Age         = 35,
                Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
            };

            var messagePackBinary    = this.serializer.Serialize(person);
            var lz4MessagePackBinary = this.lz4Serializer.Serialize(person);

            // OutputFormatter
            var outputFormatterContext = GetOutputFormatterContext(person, typeof(User), MsgPackContentType);
            var outputFormatter        = new LZ4MessagePackOutputFormatter(StandardResolver.Instance);
            await outputFormatter.WriteAsync(outputFormatterContext);

            var body = outputFormatterContext.HttpContext.Response.Body;

            Assert.NotNull(body);
            body.Position = 0;

            using (var ms = new MemoryStream())
            {
                await body.CopyToAsync(ms);

                var binary = ms.ToArray();

                binary.IsNot(messagePackBinary);
                binary.Is(lz4MessagePackBinary);
            }

            // InputFormatter
            var httpContext = new DefaultHttpContext();

            httpContext.Features.Set <IHttpResponseFeature>(new TestResponseFeature());
            httpContext.Request.Body        = new NonSeekableReadStream(messagePackBinary);
            httpContext.Request.ContentType = MsgPackContentType;

            var inputFormatterContext = CreateInputFormatterContext(typeof(User), httpContext);

            var inputFormatter = new LZ4MessagePackInputFormatter();

            var result = await inputFormatter.ReadAsync(inputFormatterContext);

            Assert.False(result.HasError);

            var userModel = Assert.IsType <User>(result.Model);

            userModel.IsStructuralEqual(person);
        }
        public void LZ4MessagePackFormatterCanNotRead()
        {
            var person = new User();

            // OutputFormatter
            var outputFormatterContext = GetOutputFormatterContext(person, typeof(User), "application/json");
            var outputFormatter        = new LZ4MessagePackOutputFormatter(StandardResolver.Instance);

            outputFormatter.CanWriteResult(outputFormatterContext).IsFalse();

            // InputFormatter
            var httpContext = new DefaultHttpContext();

            httpContext.Features.Set <IHttpResponseFeature>(new TestResponseFeature());
            httpContext.Request.Body        = new NonSeekableReadStream(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(person)));
            httpContext.Request.ContentType = "application/json";

            var inputFormatterContext = CreateInputFormatterContext(typeof(User), httpContext);

            var inputFormatter = new LZ4MessagePackInputFormatter();

            inputFormatter.CanRead(inputFormatterContext).IsFalse();
        }