public void ShouldMatchOnType_ReturnsExpectedResult(bool excludeMatchOnType, string[] acceptHeaders, bool expectedResult) { // Arrange MockContentNegotiator negotiator = new MockContentNegotiator(excludeMatchOnType); List <MediaTypeWithQualityHeaderValue> unsortedAcceptHeaders = acceptHeaders.Select(a => MediaTypeWithQualityHeaderValue.Parse(a)).ToList(); IEnumerable <MediaTypeWithQualityHeaderValue> sortedAcceptHeaders = negotiator.SortMediaTypeWithQualityHeaderValuesByQFactor(unsortedAcceptHeaders); // Act bool result = negotiator.ShouldMatchOnType(sortedAcceptHeaders); // Assert Assert.Equal(expectedResult, result); }
public void ShouldMatchOnType_ThrowsOnNull() { MockContentNegotiator negotiator = new MockContentNegotiator(); Assert.ThrowsArgumentNull(() => negotiator.ShouldMatchOnType(sortedAcceptValues: null), "sortedAcceptValues"); }