Skip to content

Commit 9149b9d

Browse files
author
Arnd R. Strube
committed
Move mock().expectNCalls() to the end of Simple Scenario
1 parent 0a070a9 commit 9149b9d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mocking_manual.markdown

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ If the call to productionCode wouldn't happen, then the test would fail with the
101101
ACTUAL calls that did happen:
102102
<none>
103103

104+
Sometimes you expect *several identical calls* to the same function, for example five calls to productionCode. There is a convenient shorthand for that situation:
105+
106+
{% highlight c++ %}
107+
mock().expectNCalls(5, "productionCode");
108+
{% endhighlight %}
109+
104110
<a id="objects"> </a>
105111

106112
### Using Objects
@@ -564,12 +570,6 @@ return mock_c()->returnDoubleValueOrDefault(2.25);
564570

565571
### Miscellaneous
566572

567-
If you expect several identical calls, for example five calls to productionCode, you can also use:
568-
569-
{% highlight c++ %}
570-
mock().expectNCalls(5, "productionCode");
571-
{% endhighlight %}
572-
573573
If you want your test to be more explicit about that a certain mocked function call should not occur, you can write (v3.8):
574574

575575
{% highlight c++ %}

0 commit comments

Comments
 (0)