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 ICalculator { int Add(int a, int b); }
[Test] public void a_test() {
var calculator = Substitute.For<ICalculator>();
calculator.Add(0, Arg.Any<int>()).Returns(5);
Assert.AreEqual(5, calculator.Add(0, 1));
}
This test fails at the Assert.AreEqual because it gets 0, not 5.
I expected to get an AmbiguousArgumentsException because it could not tell which argument the Arg.Any<int>() arg matcher applied to. Either that or have the test pass because I called Add(0, 1) which I stubbed to give 5.
The text was updated successfully, but these errors were encountered:
This test fails at the
Assert.AreEqual
because it gets0
, not5
.I expected to get an
AmbiguousArgumentsException
because it could not tell which argument theArg.Any<int>()
arg matcher applied to. Either that or have the test pass because I calledAdd(0, 1)
which I stubbed to give5
.The text was updated successfully, but these errors were encountered: