The type-erased expectation type with shared ownership.
More...
#include <Expectation.hpp>
|
| virtual | ~Expectation ()=default |
| | Defaulted virtual destructor.
|
| | Expectation (Expectation const &)=default |
| | Defaulted copy-constructor.
|
| Expectation & | operator= (Expectation const &)=default |
| | Defaulted copy-assignment-operator.
|
| | Expectation (Expectation &&)=default |
| | Defaulted move-constructor.
|
| Expectation & | operator= (Expectation &&)=default |
| | Defaulted move-assignment-operator.
|
| template<typename Signature, control_policy ControlPolicy, finalize_policy_for< Signature > FinalizePolicy, expectation_policy_for< Signature >... Policies> |
| | Expectation (std::in_place_type_t< Signature > const, util::SourceLocation from, reporting::TargetReport target, ControlPolicy controlPolicy, FinalizePolicy finalizePolicy, Policies... policies) |
| | Constructs the expectation with the given arguments.
|
| util::SourceLocation const & | from () const noexcept |
| | Returns the source-location, where this expectation was created.
|
| StringT const & | mock_name () const noexcept |
| | Returns the name of the related mock.
|
| reporting::ExpectationReport | report () const |
| | Creates a report of the internal state.
|
| bool | is_satisfied () const noexcept |
| | Queries all policies, whether they are satisfied.
|
| bool | is_applicable () const noexcept |
| | Queries the control policy, whether it's in the applicable state.
|
| template<typename Return, typename... Args> |
| std::optional< MatchResults > | matches (call::Info< Return, Args... > const &callInfo) const |
| | Queries all policies, whether they accept the given call.
|
| template<typename Return, typename... Args> |
| Return | consume (call::Info< Return, Args... > const &callInfo) |
| | Informs all policies that the given call was accepted.
|
The type-erased expectation type with shared ownership.
This type serves as a value-type for a single expectation and can be freely copied around, without duplicating the actual expectation.
◆ ~Expectation()
| virtual mimicpp::expectation::Expectation::~Expectation |
( |
| ) |
|
|
virtualdefault |
Defaulted virtual destructor.
◆ Expectation() [1/3]
| mimicpp::expectation::Expectation::Expectation |
( |
Expectation const & | | ) |
|
|
default |
Defaulted copy-constructor.
◆ Expectation() [2/3]
| mimicpp::expectation::Expectation::Expectation |
( |
Expectation && | | ) |
|
|
default |
Defaulted move-constructor.
◆ Expectation() [3/3]
template<typename Signature, control_policy ControlPolicy, finalize_policy_for< Signature > FinalizePolicy, expectation_policy_for< Signature >... Policies>
| mimicpp::expectation::Expectation::Expectation |
( |
std::in_place_type_t< Signature > const | , |
|
|
util::SourceLocation | from, |
|
|
reporting::TargetReport | target, |
|
|
ControlPolicy | controlPolicy, |
|
|
FinalizePolicy | finalizePolicy, |
|
|
Policies... | policies ) |
|
inlineexplicitnodiscard |
Constructs the expectation with the given arguments.
- Template Parameters
-
| Signature | The target signature. |
| ControlPolicy | The control-policy type. |
| FinalizePolicy | The finalize-policy type. |
| Policies | The expectation-policies types. |
- Parameters
-
| from | The source-location, where this expectation was created. |
| target | Information about the target-mock. |
| controlPolicy | The control-policy. |
| finalizePolicy | The finalize-policy. |
| policies | The expectation-policies. |
◆ consume()
template<typename Return, typename... Args>
| Return mimicpp::expectation::Expectation::consume |
( |
call::Info< Return, Args... > const & | callInfo | ) |
|
|
inlinenodiscard |
Informs all policies that the given call was accepted.
- Parameters
-
| callInfo | The call to be consumed. |
This function is called when a match was made.
◆ from()
Returns the source-location, where this expectation was created.
- Returns
- Immutable reference to the source-location.
◆ is_applicable()
| bool mimicpp::expectation::Expectation::is_applicable |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Queries the control policy, whether it's in the applicable state.
- Returns
- Returns true if the expectation is applicable.
◆ is_satisfied()
| bool mimicpp::expectation::Expectation::is_satisfied |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Queries all policies, whether they are satisfied.
- Returns
- Returns true if all policies are satisfied.
◆ matches()
template<typename Return, typename... Args>
| std::optional< MatchResults > mimicpp::expectation::Expectation::matches |
( |
call::Info< Return, Args... > const & | callInfo | ) |
const |
|
inlinenodiscard |
Queries all policies, whether they accept the given call.
- Parameters
-
| callInfo | The call to be matched. |
- Returns
- the requirements outcomes when the call matches the expectation signature; otherwise std::nullopt is returned.
◆ mock_name()
| StringT const & mimicpp::expectation::Expectation::mock_name |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Returns the name of the related mock.
- Returns
- Immutable reference to the mock-name.
◆ operator=() [1/2]
Defaulted move-assignment-operator.
◆ operator=() [2/2]
Defaulted copy-assignment-operator.
◆ report()
Creates a report of the internal state.
- Returns
- A newly generated report.
◆ operator==
The documentation for this class was generated from the following file: