public interface ITarget
{
void Call(string s);
}
[Test]
public void CallOrderReceiveWithAnyArgs()
{
var target1 = Substitute.For<ITarget>();
var target2 = Substitute.For<ITarget>();
target1.Call("A");
target2.Call("B");
// Pass
target1.ReceivedWithAnyArgs().Call(null);
target2.ReceivedWithAnyArgs().Call(null);
// Pass
Received.InOrder(() =>
{
target1.Received().Call(Arg.Any<string>());
target2.Received().Call(Arg.Any<string>());
});
// Fail
Received.InOrder(() =>
{
target1.ReceivedWithAnyArgs().Call(null);
target2.ReceivedWithAnyArgs().Call(null);
});
}Received.InOrder(() => {target1.Call(Arg.Any<string>());target2.Call(Arg.Any<string>());});
--
You received this message because you are subscribed to the Google Groups "NSubstitute" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nsubstitute+unsubscribe@googlegroups.com.
To post to this group, send email to nsubs...@googlegroups.com.
Visit this group at https://groups.google.com/group/nsubstitute.
For more options, visit https://groups.google.com/d/optout.