MCPcopy Create free account
hub / github.com/cpputest/cpputest / TEST

Function TEST

tests/CppUTestExt/MockCheatSheetTest.cpp:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49};
50
51TEST(MockCheatSheet, foo)
52{
53 /* Record 2 calls to Foo. Return different values on each call */
54 mock().expectOneCall("Foo")
55 .withParameter("param_string", "value_string")
56 .withParameter("param_int", 10)
57 .andReturnValue(30);
58 mock().expectOneCall("Foo")
59 .ignoreOtherParameters()
60 .andReturnValue(50);
61
62 /* Call production code */
63 productionCodeFooCalls();
64}
65
66TEST(MockCheatSheet, bar)
67{

Callers

nothing calls this directly

Calls 2

productionCodeFooCallsFunction · 0.85
productionCodeBarCallsFunction · 0.85

Tested by

no test coverage detected