blob: 87a2dc5e2f0aedd68e59b2c7727139a6858af00c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#ifndef BANDIT_BELESSTHAN_H
#define BANDIT_BELESSTHAN_H
#include "Matcher.h"
namespace bandit { namespace Matchers {
template<typename T>
class BeLessThan : public Matcher
{
public:
explicit BeLessThan(const T& expectedValue) : Matcher(), _expectedValue(expectedValue) {}
template<typename U>
bool matches(const U& actualValue) const
{
return actualValue < _expectedValue;
}
protected:
virtual std::string failure_message_end() const
{
std::ostringstream ss;
ss << "be less than <" << _expectedValue << ">";
return ss.str();
}
private:
const T& _expectedValue;
};
template<typename T>
BeLessThan<T> be_less_than(const T& expectedValue)
{
return BeLessThan<T>(expectedValue);
}
}}
#endif // BANDIT_BELESSTHAN_H
|