|
mimic++ v10.0.1
|
Central management type for all expectations. More...
#include <Registry.hpp>
Public Types | |
| using | Ptr = std::shared_ptr<Registry> |
Public Member Functions | |
| Registry (Registry const &)=delete | |
| Deleted copy-constructor. | |
| Registry & | operator= (Registry const &)=delete |
| Deleted copy-assignment-operator. | |
| Registry (Registry &&)=delete | |
| Deleted move-constructor. | |
| Registry & | operator= (Registry &&)=delete |
| Deleted move-assignment-operator. | |
| ~Registry ()=default | |
| Defaulted destructor. | |
| Registry ()=default | |
| Defaulted default constructor. | |
| template<typename... Args> requires std::constructible_from<Expectation, Args...> | |
| Expectation | create (Args &&... args) |
| Creates a new expectation from the given arguments. | |
| void | remove (Expectation const &expectation) |
| Removes the given expectation from the internal storage. | |
| template<typename Signature> | |
| signature_return_type_t< Signature > | handle_call (reporting::TargetReport target, call::info_for_signature_t< Signature > call) |
| Handles the incoming call. | |
Central management type for all expectations.
This type is responsible for actually creating expectations and needs to be informed about incoming calls. Eventually, it needs to get notified when expectations are no longer valid candidates and shall be removed.
| using mimicpp::expectation::Registry::Ptr = std::shared_ptr<Registry> |
|
delete |
Deleted copy-constructor.
|
nodiscarddelete |
Deleted move-constructor.
|
default |
Defaulted destructor.
|
nodiscarddefault |
Defaulted default constructor.
|
inlinenodiscard |
Creates a new expectation from the given arguments.
| args | The expectation construction arguments. |
|
inlinenodiscard |
Handles the incoming call.
| target | The mock-target, which received the call. |
| call | The call to be handled. |
This function queries all stored expectations, whether they accept the call. If multiple matches are possible, the best match is selected and a "matched"-report is emitted. If no matches are found, "no matched"-report is emitted and the call is aborted (e.g. by throwing an exception or terminating). If matches are possible, but all expectations are saturated, an "inapplicable match"-report is emitted.
Deleted move-assignment-operator.
Deleted copy-assignment-operator.
|
inline |
Removes the given expectation from the internal storage.
| expectation | The expectation to be removed. |
This function also checks whether the removed expectation is satisfied. If not, an unfulfilled expectation- report is emitted.