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
NSubstitute does not complain about the following code:
sub1.GetItem(Arg.Any<string>()).Returns(newItem());sub2.GetSignature(...).Returns(Arg.Any<string>())// <-- THIS IS THE PROBLEM// Call to GetItem(...)
sub1.GetItem("mystring");sub1.ReceivedWithAnyArgs(1).GetItem(...);// exception is thrown:// Additional information: Expected to receive exactly 1 call matching:// GetItem(any String)//Actually received no matching calls.
After fixing
sub2.GetSignature(...).Returns(Arg.Any<string>())
to
sub2.GetSignature(...).Returns("")
the exception is gone.
If using Arg.Any<>() in .Returns() statement causes problems it would be good to have a compile time error or at least a self-descriptive exception instead of just missing call.
The text was updated successfully, but these errors were encountered:
NSubstitute does not complain about the following code:
After fixing
to
the exception is gone.
If using
Arg.Any<>()
in.Returns()
statement causes problems it would be good to have a compile time error or at least a self-descriptive exception instead of just missing call.The text was updated successfully, but these errors were encountered: