Takes the ownership of an expectation and check whether it's satisfied during destruction.
More...
#include <Expectation.hpp>
|
const std::source_location & | loc |
|
Takes the ownership of an expectation and check whether it's satisfied during destruction.
The owned Expectation is type-erased. This comes in handy, when users want to store ScopedExpectations in a single container.
◆ ~ScopedExpectation()
mimicpp::ScopedExpectation::~ScopedExpectation |
( |
| ) |
|
|
inline |
Removes the owned expectation from the ExpectationCollection and checks, whether it's satisfied.
- Exceptions
-
In | cases of an unsatisfied expectation, the destructor is expected to throw of terminate otherwise. |
◆ ScopedExpectation() [1/2]
template<typename Signature >
|
inlineexplicitnodiscardnoexcept |
Constructor, which generates the type-erase storage.
- Template Parameters
-
- Parameters
-
collection | The expectation collection, the expectation will be attached to. |
expectation | The expectation. |
◆ ScopedExpectation() [2/2]
Defaulted move-constructor.
◆ explicit()
template<typename T >
requires requires(const std::source_location&
loc) { { std::declval<T&&>().finalize(
loc) } -> std::convertible_to<
ScopedExpectation>; }
mimicpp::ScopedExpectation::explicit |
( |
false | | ) |
const && |
|
nodiscard |
A constructor, which accepts objects, which can be finalized (e.g. ExpectationBuilder).
- Template Parameters
-
- Parameters
-
object | The object to be finalized. |
loc | The source-location. |
◆ from()
const std::source_location & mimicpp::ScopedExpectation::from |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Queries the stored expectation for it's stored source-location.
- Returns
- The stored source-location.
◆ is_satisfied()
bool mimicpp::ScopedExpectation::is_satisfied |
( |
| ) |
const |
|
inlinenodiscard |
Queries the stored expectation, whether it's satisfied.
- Returns
- True, if satisfied.
◆ operator=() [1/2]
Deleted copy-assignment-operator.
◆ operator=() [2/2]
Defaulted move-assignment-operator.
◆ loc
const std::source_location& mimicpp::ScopedExpectation::loc |
Initial value:= std::source_location::current())
{
}
Takes the ownership of an expectation and check whether it's satisfied during destruction.
Definition Expectation.hpp:568
const std::source_location & loc
Definition Expectation.hpp:679
ScopedExpectation(std::shared_ptr< ExpectationCollection< Signature > > collection, std::shared_ptr< typename ExpectationCollection< Signature >::ExpectationT > expectation) noexcept
Constructor, which generates the type-erase storage.
Definition Expectation.hpp:655
The documentation for this class was generated from the following file: