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
When a method/property is setup with the same arguments, only the last Setup() will be use:
For example, here the result variable will return 2 because the second Setup() is used.
var stream = new Mock<Stream>(MockBehavior.Strict);
stream.Setup(s => s.Seek(10, SeekOrigin.Begin))
.Returns(1);
stream.Setup(s => s.Seek(It.IsAny<long>(), It.IsAny<SeekOrigin>()))
.Returns(2);
var result = stream.Object.Seek(10, SeekOrigin.Begin);
The text was updated successfully, but these errors were encountered:
When a method/property is setup with the same arguments, only the last
Setup()
will be use:For example, here the
result
variable will return2
because the secondSetup()
is used.The text was updated successfully, but these errors were encountered: