Takes the ownership of an expectation and checks whether it's satisfied during destruction.
More...
|
| | Owner (Owner const &)=delete |
| | Deleted copy-constructor.
|
| Owner & | operator= (Owner const &)=delete |
| | Deleted copy-assignment-operator.
|
| | ~Owner () noexcept(false) |
| | Removes the owned expectation from the Registry and checks whether it's satisfied.
|
| | Owner (Registry::Ptr registry, Expectation expectation) |
| | Constructor, which generates the type-erase storage.
|
| template<detail::finalizable T> |
| | explicit (false) const expr Owner(T &&object |
| | A constructor accepting objects, which can be finalized (i.e., expectation::Builder).
|
| Owner & | operator= (Owner &&)=default |
| | Defaulted move-assignment-operator.
|
| bool | is_satisfied () const |
| | Queries the stored expectation, whether it's satisfied.
|
| bool | is_applicable () const |
| | Queries the stored expectation, whether it's applicable.
|
| util::SourceLocation const & | from () const noexcept |
| | Queries the stored expectation for it's stored source-location.
|
| StringT const & | mock_name () const noexcept |
| | Queries the stored expectation for the name of the related mock.
|
Takes the ownership of an expectation and checks whether it's satisfied during destruction.
Instances of this type have exclusive ownership of their attached expectations, which will be checked during destruction.
They can be freely passed around and may even outlive their target-mock.
std::optional<mimicpp::ScopedExpectation> expectation{};
{
expectation = mock.expect_call();
mock();
}
expectation.reset();