public void IsJson_DetectsJson(string input, bool expected) { // Arrange HttpContent content = new StringContent(string.Empty); content.Headers.ContentType = MediaTypeHeaderValue.Parse(input); // Act bool actual = content.IsJson(); // Assert Assert.Equal(expected, actual); }
public void IsJson_HandlesNullContentType() { // Arrange HttpContent content = new StringContent(string.Empty); content.Headers.ContentType = null; // Act bool actual = content.IsJson(); // Assert Assert.False(actual); }