Moq-Sequences icon indicating copy to clipboard operation
Moq-Sequences copied to clipboard

Parameters are ignored

Open iheb719 opened this issue 1 year ago • 0 comments

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
}

iheb719 avatar Nov 21 '24 04:11 iheb719