mocking.md (googletest-release-1.11.0) | : | mocking.md (googletest-release-1.12.0) | ||
---|---|---|---|---|
skipping to change at line 251 | skipping to change at line 251 | |||
```cpp | ```cpp | |||
using ::testing::Return; | using ::testing::Return; | |||
... | ... | |||
EXPECT_CALL(my_mock, GetNumber()) | EXPECT_CALL(my_mock, GetNumber()) | |||
.WillOnce(Return(1)) | .WillOnce(Return(1)) | |||
.WillOnce(Return(2)) | .WillOnce(Return(2)) | |||
.WillOnce(Return(3)); | .WillOnce(Return(3)); | |||
``` | ``` | |||
The `WillOnce` clause can be used any number of times on an expectation. | The `WillOnce` clause can be used any number of times on an expectation. Unlike | |||
`WillRepeatedly`, the action fed to each `WillOnce` call will be called at most | ||||
once, so may be a move-only type and/or have an `&&`-qualified call operator. | ||||
#### WillRepeatedly {#EXPECT_CALL.WillRepeatedly} | #### WillRepeatedly {#EXPECT_CALL.WillRepeatedly} | |||
`.WillRepeatedly(`*`action`*`)` | `.WillRepeatedly(`*`action`*`)` | |||
Specifies the mock function's actual behavior when invoked, for all subsequent | Specifies the mock function's actual behavior when invoked, for all subsequent | |||
matching function calls. Takes effect after the actions specified in the | matching function calls. Takes effect after the actions specified in the | |||
[`WillOnce`](#EXPECT_CALL.WillOnce) clauses, if any, have been performed. | [`WillOnce`](#EXPECT_CALL.WillOnce) clauses, if any, have been performed. | |||
The parameter *`action`* represents the | The parameter *`action`* represents the | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added |