4#include <source_location>
9#include "expectations/expectation.hpp"
27class ItD :
public ItBase {
29 using Block = std::function<void(
ItD&)>;
52 ItD(std::source_location location,
const char* description, Block block)
53 : ItBase(location, description), block(std::move(block)) {}
72 ItD(std::source_location location, Block block) : ItBase(location), block(block) {}
89class ItCD :
public ItBase {
91 using Block = std::function<void(ItCD<T>&)>;
108 ItCD(std::source_location location, T&
subject,
const char* description, Block block)
109 : ItBase(location, description), block(block),
subject(
subject) {}
111 ItCD(std::source_location location, T& subject, Block block) :
ItBase(location), block(block), subject(subject) {}
113 ExpectationValue<T> is_expected(std::source_location location = std::source_location::current()) {
114 return {*
this, subject, location};
128template <Util::is_not_functional T>
130 return {*
this, value, location};
133template <Util::is_functional T>
135 return {*
this, block, location};
140 return {*
this, let.value(), location};
152 std::source_location location) {
153 return {*
this, init_list, location};
157 return {*
this, std::string(str), location};
Definition expectation.hpp:438
Definition expectation.hpp:397
Base class for it expressions.
Definition it_base.hpp:32
ExpectationValue< T > expect(T value, std::source_location location=std::source_location::current())
The expect object generator for objects and LiteralTypes.
Definition it.hpp:129
An it embedded in a ClassDescription.
Definition it.hpp:89
T & subject
A reference to the parent ClassDescription's subject.
Definition it.hpp:105
ItD(std::source_location location, const char *description, Block block)
The primary ItD constructor.
Definition it.hpp:52
ItD(std::source_location location, Block block)
The anonymous ItD constructor.
Definition it.hpp:72
A container that memoizes the result of a block in `it's.
Definition let.hpp:34