You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public interface ITarget
{
public float Rotation { get; set; }
}
And the following test code:
ITarget target = Substitute.For<ITarget>();
target.Received().Rotation = Arg.Any<float>(); //Here is the warning
I receive the warning NS1004 - Argument matcher used with a non-virtual member of a class.. My aim is to test whether the rotation of the target got set to anything. Is this warning supposed to be there? Because the property is virtual, is it not (I could be wrong)? Also the code seems to be working if I am not mistaken.
The text was updated successfully, but these errors were encountered:
Hi
Arg matcher analyzer has a bug and sometimes it reports false positives. Here are some bug reports which basically cover your issue #159 #160
Your code is correct so you can safely suppress warning. I will try to publish new version this month (hopefully) so these kind of false positives should be gone
Hello, thank you for your support.
If I have the following interface:
And the following test code:
I receive the warning
NS1004 - Argument matcher used with a non-virtual member of a class.
. My aim is to test whether the rotation of the target got set to anything. Is this warning supposed to be there? Because the property is virtual, is it not (I could be wrong)? Also the code seems to be working if I am not mistaken.The text was updated successfully, but these errors were encountered: