/// <summary> /// Asserts whether the header ends with a specified value /// </summary> /// <param name="assertion">The header assertion</param> /// <param name="value">The value the header should end with</param> /// <param name="comparison">A comparison to use for the header value</param> /// <returns>A header assertion</returns> public static HeaderAssertion WithValueEndingWith(this HeaderAssertion assertion, string value, StringComparison comparison) { return(assertion.WithValueComparer(values => values.Any(v => v.EndsWith(value, comparison)), $"Expected value starting with '{value}' not found.")); }
/// <summary> /// Asserts whether the header has a specified value /// </summary> /// <param name="assertion">The header assertion</param> /// <param name="value">The header value</param> /// <param name="comparer">An equality comparer to use for the header value</param> /// <returns>A header assertion</returns> public static HeaderAssertion WithValue(this HeaderAssertion assertion, string value, IEqualityComparer <string> comparer) { return(assertion.WithValueComparer(values => values.Contains(value, comparer), $"Expected value '{value}' not found.")); }