public async Task Throws_HttpContentSerializationException_If_Content_Is_Null() { var serializer = new MockedHttpContentSerializer(); Func <Task> testCode = async() => await serializer.DeserializeAsync(null, typeof(object)); await testCode.Should().ThrowAsync <HttpContentSerializationException>(); }
public async Task Deserializes_NoContent() { var serializer = new MockedHttpContentSerializer(); var content = new ByteArrayContent(new byte[0]); var result = await serializer.DeserializeAsync(content, typeof(NoContent)); result.Should().BeOfType <NoContent>(); }
public async Task Throws_ArgumentNullException_For_ContentType() { var serializer = new MockedHttpContentSerializer(); var content = new ByteArrayContent(new byte[0]); Func <Task> testCode = async() => await serializer.DeserializeAsync(content, null); await testCode.Should().ThrowAsync <ArgumentNullException>(); }
public async Task Doesnt_Throw_HttpContentSerializationException_If_Content_Is_Null_And_Deserializing_NoContent() { var serializer = new MockedHttpContentSerializer(); await serializer.DeserializeAsync(null, typeof(NoContent)); // Should not throw. }