Open poeschlr opened 3 years ago
It only check for mocks that are in the sequence.
Verify(Method(mock, foo) + Method(mock2, foo));
will only check that there is no other call from mock
or mock2
between these two calls, but not from mock1
because it doesn't appear in the sequence verified.
You can use Verification Scoping if you want to set a custom list of mocks that will be considered in the verification process, instead of relying on the automic list that only contains mocks that are directly referenced: https://github.com/eranpeer/FakeIt/wiki/Quickstart#verification-scoping
In your example, it would look like this:
Using(mock, mock1, mock2).Verify(Method(mock, foo) + Method(mock2, foo));
Hi,
The example from the quistart for sequence verification does imply that the "+" operator would match an exact sequence. If all called functions are from the same mock then it detects if there is a function between the two mocked functions i have around the "+" operator but if these 3 functions are from different mocks then it does not seem to detect this.
Common part of example:
The working example (fails as expected)
The non working example (does not fail as would be expected)
We use the single header file for catch2. And to be sure it is not already fixed downloaded (and integrated) the version of today (Relevant info from header:
Generated: 2021-05-12 13:47:04.979584
-- And yes this version seems to have an issue withfail
but i will make a separate issue there). We compile with MSVC-2019.