Open mpdelbuono opened 3 months ago
Would gladly accept a PR for this enhancement.
Argument types must match exactly, so it's working as designed.
This could be enhanced in that PR by looking at implicit operators, but that adds another reflection lookup and invocation.
Describe the Bug
Using the code shown below, we get the following error:
We suspect the cause must be the coercion from
string
toStringValues
via the implicit conversion operator. When using It.Is<StringValues>() the code works flawlessly.Steps to Reproduce
The following code reproduces this behavior:
Expected Behavior
Not crashing in this way. At a minimum, an error message indicating what was invalid about the matcher. Ideally, it would allow this coercion, since it heavily matches the code under test.
Exception with Stack Trace
Version Info
Tested on Moq 4.20.69 and 4.20.70
The test case above uses the following NuGet packages:
Additional Info