Keep track of function invocations.
More...
#include <mock.hpp>
|
using | args = std::vector< std::any > |
| Functions arguments. More...
|
|
using | functions = std::unordered_map< std::string, std::vector< args > > |
| Map of all functions. More...
|
|
|
void | push (std::string name, args args={}) const |
|
auto | find (const std::string &name) const -> std::vector< args > |
|
void | clear (const std::string &name) const noexcept |
|
void | clear () const noexcept |
|
auto | empty () const noexcept -> bool |
|
Keep track of function invocations.
◆ args
◆ functions
◆ clear() [1/2]
void irccd::test::mock::clear |
( |
| ) |
const |
|
noexcept |
Clear all function invocations.
◆ clear() [2/2]
void irccd::test::mock::clear |
( |
const std::string & |
name | ) |
const |
|
noexcept |
Clear all function invocations by name.
- Parameters
-
◆ empty()
auto irccd::test::mock::empty |
( |
| ) |
const -> bool |
|
noexcept |
Tells if no functions have been called.
- Returns
- true if no functions have been called
◆ find()
auto irccd::test::mock::find |
( |
const std::string & |
name | ) |
const -> std::vector< args > |
Get all function invocations by name.
- Parameters
-
- Returns
- the list of functions and their arguments or empty if not called
◆ push()
void irccd::test::mock::push |
( |
std::string |
name, |
|
|
args |
args = {} |
|
) |
| const |
Register a new function invocation.
- Parameters
-
name | the function name |
args | the arguments list |
The documentation for this class was generated from the following file: