Open
Description
Describe the bug
When passing a parameter from the substitute itself to a (received) assertion it passes although it clearly shouldn't.
To Reproduce
public interface ICandidate
{
string Name { get; set; }
void Perform(string input, IEnumerable<string> values);
}
[TestMethod]
public void Substitute_Received_ShouldNotPass()
{
var candidate = Substitute.For<ICandidate>();
candidate.Perform(candidate.Name, new[] { "a" });
candidate.Received(1).Perform(candidate.Name, Arg.Is<IEnumerable<string>>(new[] { "b" }));
}
Expected behaviour
The example test should not pass due to the not matching second argument.
Environment:
- NSubstitute version: 5.1.0.0
- NSubstitute.Analyzers version: CSharp 1.0.16
- Platform: .net framework 4.8 on windows