public async Task ByteArrayContentHelperTests_Create_WithNullContentType() { // Arrange var content = Encoding.UTF8.GetBytes("test"); // Act var result = ByteArrayContentHelper.Create(content, null); // Assert result.Headers.ContentType.Should().BeNull(); (await result.ReadAsByteArrayAsync()).Should().BeEquivalentTo(content); }
public async Task ByteArrayContentHelperTests_Create(string test, string expected) { // Arrange var content = Encoding.UTF8.GetBytes("test"); var contentType = MediaTypeHeaderValue.Parse(test); // Act var result = ByteArrayContentHelper.Create(content, contentType); // Assert result.Headers.ContentType.ToString().Should().Be(expected); (await result.ReadAsByteArrayAsync()).Should().BeEquivalentTo(content); }