17 #ifndef COM_BORA_SOFTWARE__BALAU_TESTING__MATCHERS 18 #define COM_BORA_SOFTWARE__BALAU_TESTING__MATCHERS 20 #include <Balau/Testing/Impl/MatcherClasses.hpp> 28 inline ExpectedValue<E, MatcherCompareEquals, EvNotUsed, EvNotUsed>
is(
const E & expected) {
29 return ExpectedValue<E, MatcherCompareEquals, EvNotUsed, EvNotUsed>(expected);
36 inline ExpectedValue<E, MatcherCompareNotEqual, EvNotUsed, EvNotUsed>
isNot(
const E & expected) {
37 return ExpectedValue<E, MatcherCompareNotEqual, EvNotUsed, EvNotUsed>(expected);
43 inline ExpectedValue<void *, MatcherCompareNotEqual, EvNotUsed, EvNotUsed>
isNotNull() {
44 return ExpectedValue<void *, MatcherCompareNotEqual, EvNotUsed, EvNotUsed>(
nullptr);
51 inline ExpectedValue<E, MatcherCompareGreaterThan, EvNotUsed, EvNotUsed>
isGreaterThan(
const E & expected) {
52 return ExpectedValue<E, MatcherCompareGreaterThan, EvNotUsed, EvNotUsed>(expected);
59 inline ExpectedValue<E, MatcherCompareGreaterThanOrEqualTo, EvNotUsed, EvNotUsed>
isGreaterThanOrEqualTo(
const E & expected) {
60 return ExpectedValue<E, MatcherCompareGreaterThanOrEqualTo, EvNotUsed, EvNotUsed>(expected);
67 inline ExpectedValue<E, MatcherCompareLessThan, EvNotUsed, EvNotUsed>
isLessThan(
const E & expected) {
68 return ExpectedValue<E, MatcherCompareLessThan, EvNotUsed, EvNotUsed>(expected);
75 inline ExpectedValue<E, MatcherCompareLessThanOrEqualTo, EvNotUsed, EvNotUsed>
isLessThanOrEqualTo(
const E & expected) {
76 return ExpectedValue<E, MatcherCompareLessThanOrEqualTo, EvNotUsed, EvNotUsed>(expected);
82 template <
typename E,
typename V>
83 inline ExpectedValue<E, MatcherCompareAlmostEqual, V, EvNotUsed>
isAlmostEqual(
const E & expected,
const V & errorDelta) {
84 return ExpectedValue<E, MatcherCompareAlmostEqual, V, EvNotUsed>(expected, errorDelta);
91 inline ExpectedValue<E, MatcherCompareStartsWith, EvNotUsed, EvNotUsed>
startsWith(
const E & expected) {
92 return ExpectedValue<E, MatcherCompareStartsWith, EvNotUsed, EvNotUsed>(expected);
99 inline ExpectedValue<E, MatcherCompareEndsWith, EvNotUsed, EvNotUsed>
endsWith(
const E & expected) {
100 return ExpectedValue<E, MatcherCompareEndsWith, EvNotUsed, EvNotUsed>(expected);
106 template <
typename E>
107 inline ExpectedValue<E, MatcherCompareContains, EvNotUsed, EvNotUsed>
contains(
const E & expected) {
108 return ExpectedValue<E, MatcherCompareContains, EvNotUsed, EvNotUsed>(expected);
114 template <
typename E>
115 inline ExpectedValue<E, MatcherCompareDoesNotContain, EvNotUsed, EvNotUsed>
doesNotContain(
const E & expected) {
116 return ExpectedValue<E, MatcherCompareDoesNotContain, EvNotUsed, EvNotUsed>(expected);
122 template <
typename T>
inline const IsAExpectation<T>
isA() {
123 return IsAExpectation<T>();
129 template <
typename E>
inline const ThrowTypeExpectation<E>
throws() {
130 return ThrowTypeExpectation<E>();
136 template <
typename E>
inline const ThrowExpectation<E>
throws(
const E & expected) {
137 return ThrowExpectation<E>(expected);
145 template <
typename E>
146 inline const ThrowExpectationWithPredicate<E>
throws(
const std::function<
bool (
const E & )> & predicate) {
147 return ThrowExpectationWithPredicate<E>(predicate);
155 template <
typename E,
typename C>
156 inline const ThrowExpectationWithFunction<E, C>
throws(
const E & expected, C comparisonFunction) {
157 return ThrowExpectationWithFunction<E, C>(expected, comparisonFunction);
162 #endif // COM_BORA_SOFTWARE__BALAU_TESTING__MATCHERS ExpectedValue< E, MatcherCompareLessThan, EvNotUsed, EvNotUsed > isLessThan(const E &expected)
Is the actual value less than the supplied expected value?
Definition: Matchers.hpp:67
ExpectedValue< E, MatcherCompareGreaterThanOrEqualTo, EvNotUsed, EvNotUsed > isGreaterThanOrEqualTo(const E &expected)
Is the actual value greater than or equal to the supplied expected value?
Definition: Matchers.hpp:59
ExpectedValue< E, MatcherCompareNotEqual, EvNotUsed, EvNotUsed > isNot(const E &expected)
Is the actual value not equal to the supplied expected value?
Definition: Matchers.hpp:36
ExpectedValue< E, MatcherCompareDoesNotContain, EvNotUsed, EvNotUsed > doesNotContain(const E &expected)
Does the actual value not contain the supplied expected value?
Definition: Matchers.hpp:115
const IsAExpectation< T > isA()
Is the type of the actual value castable to the specified type?
Definition: Matchers.hpp:122
ExpectedValue< E, MatcherCompareAlmostEqual, V, EvNotUsed > isAlmostEqual(const E &expected, const V &errorDelta)
Is the actual value equal to within the specified error limit to the supplied expected value...
Definition: Matchers.hpp:83
ExpectedValue< E, MatcherCompareStartsWith, EvNotUsed, EvNotUsed > startsWith(const E &expected)
Does the actual value start with the supplied expected value?
Definition: Matchers.hpp:91
ExpectedValue< E, MatcherCompareEquals, EvNotUsed, EvNotUsed > is(const E &expected)
Is the actual value equal to the supplied expected value?
Definition: Matchers.hpp:28
The test runner and test assertion functions.
Definition: Assertions.hpp:23
ExpectedValue< E, MatcherCompareGreaterThan, EvNotUsed, EvNotUsed > isGreaterThan(const E &expected)
Is the actual value greater than the supplied expected value?
Definition: Matchers.hpp:51
ExpectedValue< void *, MatcherCompareNotEqual, EvNotUsed, EvNotUsed > isNotNull()
Is the actual value not equal to the supplied expected value?
Definition: Matchers.hpp:43
ExpectedValue< E, MatcherCompareEndsWith, EvNotUsed, EvNotUsed > endsWith(const E &expected)
Does the actual value end with the supplied expected value?
Definition: Matchers.hpp:99
ExpectedValue< E, MatcherCompareContains, EvNotUsed, EvNotUsed > contains(const E &expected)
Does the actual value contains the supplied expected value?
Definition: Matchers.hpp:107
ExpectedValue< E, MatcherCompareLessThanOrEqualTo, EvNotUsed, EvNotUsed > isLessThanOrEqualTo(const E &expected)
Is the actual value less than or equal to the supplied expected value?
Definition: Matchers.hpp:75