コード例 #1
0
        public async Task Deserializes_NoContent()
        {
            var serializer   = new NoContentSerializer();
            var deserialized = await serializer.DeserializeAsync(new ByteArrayContent(Array.Empty <byte>()), typeof(NoContent));

            deserialized.Should().BeOfType <NoContent>();
        }
コード例 #2
0
        public async Task Throws_NotSupportedException_When_Deserializing_Other_Type()
        {
            var         serializer = new NoContentSerializer();
            Func <Task> testCode   = async() => await serializer.DeserializeAsync(new ByteArrayContent(Array.Empty <byte>()), typeof(int));

            await testCode.Should().ThrowAsync <NotSupportedException>();
        }