Moq-Sequences
Moq-Sequences copied to clipboard
Parameters are ignored
When a method is called multiple times with different parameters, all of the calls are treated the same, regardless of the parameters.
This is a sample code to illustrate the issue:
using (Sequence.Create())
{
myMock.Setup(v => v.myMethod("string1")).InSequence();
myMock.Setup(v => v.myMethod("string2")).InSequence();
// Act
myService.callMyMethodWithString2BeforeMyMethodWithString1(); // <-- That will succeed, but it should fail because the order of calls is not correct, if we take into consideration the parameters
}