Skip to content

Expand the usability of Contains.Key(...).WithValue(...) #4852

Description

@RenderMichael

I want to assert on HTTP response headers, but the DictionaryContainsKeyValuePairConstraint created by Contains.Key(...).WithValue(...) does not work on the type.

Currently the constraint checks for IDictionary and (despite the error message) also IDictionary<TKey, TValue>.

However, the HttpHeaders type implements IEnumerable<KeyValuePair<string, IEnumerable<string>>> (and of course the non-generic IEnumerable interface implicitly) and nothing else.

Would it be acceptable to expand the checks on this contraint to allow IEnumerable<KeyValuePair<TKey, TValue>> as well? I'm happy to work on it if the change would be accepted.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions