public async Task ReadFromStreamAsync_ReadsNullObject()
        {
            // Assert
            var content = new StreamMessagePackHttpContent();
            await content.WriteObjectAsync <SimpleType>(null, _serializerOptions);

            // Act
            var result = await _formatter.ReadFromStreamAsync(typeof(object), content.Stream, content, _logger);

            // Assert
            Assert.Null(result);
        }
        public async Task ReadFromStreamAsync_ReadsPrimitiveType()
        {
            // Arrange
            var expectedInt = 10;
            var content     = new StreamMessagePackHttpContent();
            await content.WriteObjectAsync(expectedInt, _serializerOptions);

            // Act
            var result = await _formatter.ReadFromStreamAsync(typeof(int), content.Stream, content, _logger);

            // Assert
            Assert.Equal(expectedInt, result);
        }
        public async Task ReadFromStreamAsync_ReadsSimpleTypes()
        {
            // Arrange
            var content = new StreamMessagePackHttpContent();
            await content.WriteObjectAsync(SimpleType.Create(), _serializerOptions);

            // Act
            var result = await _formatter.ReadFromStreamAsync(typeof(SimpleType), content.Stream, content, _logger);

            // Assert
            Assert.NotNull(result);
            var model = Assert.IsType <SimpleType>(result);

            model.Verify();
        }
        public async Task ReadFromStreamAsync_ReadsComplexTypes()
        {
            // Arrange
            var input = new ComplexType {
                Inner = new SimpleType {
                    Property = 10
                }
            };
            var content = new StreamMessagePackHttpContent();
            await content.WriteObjectAsync(input, _serializerOptions);

            // Act
            var result = await _formatter.ReadFromStreamAsync(typeof(ComplexType), content.Stream, content, _logger);

            // Assert
            Assert.NotNull(result);
            var model = Assert.IsType <ComplexType>(result);

            Assert.Equal(input.Inner.Property, model.Inner.Property);
        }