Closed
Description
Why am I getting the NS1004 warning Argument matcher used with a non-virtual member of a class for the expression Arg.Is((int? x) => x > 0)
in this code?
using NSubstitute;
namespace NSubstituteTest {
public interface IFoo { int Bar(int? x); }
public class NSubstituteTest {
public void Test(bool b)
{
var foo = Substitute.For<IFoo>();
foo.Bar(b ? null : Arg.Is((int? x) => x > 0)).Returns(42);
} // -------------------------
}
}
I am using NSubstitute.Analyzers.CSharp v1.0.14.