10Duke Scale C++ Client
Loading...
Searching...
No Matches
JSONBooleanMock.h
1#ifndef TENDUKE_TEST_MOCKS_JSONBOOLEANMOCK_H
2#define TENDUKE_TEST_MOCKS_JSONBOOLEANMOCK_H
3
4#include "json/JSONBoolean.h"
5#include "gmock/gmock.h"
6
7namespace tenduke { namespace test { namespace mocks {
8
10{
11public:
12 MOCK_METHOD(enum Type, getType, (), (const, override));
13 MOCK_METHOD(std::string, asString, (), (const, override));
14 MOCK_METHOD(bool, getValue, (), (const, override));
15
16 static std::shared_ptr<JSONBooleanMock> createShared(const bool value)
17 {
18 auto element = std::make_shared<JSONBooleanMock>();
19 EXPECT_CALL(*element, getType()).WillRepeatedly(::testing::Return(JSONBoolean::BOOLEAN));
20 EXPECT_CALL(*element, getValue()).WillRepeatedly(::testing::Return(value));
21 EXPECT_CALL(*element, asString()).WillRepeatedly(::testing::Return(value ? "true" : "false"));
22
23 return element;
24 }
25};
26
27}}}
28
29#endif //TENDUKE_TEST_MOCKS_JSONBOOLEANMOCK_H
JSON boolean.
Definition JSONBoolean.h:12
virtual bool getValue() const =0
Returns the value.
virtual enum Type getType() const =0
Returns type of this element.
virtual std::string asString() const =0
Returns string representation of this element.
Type
Type of the element.
Definition JSONElement.h:17
Definition JSONBooleanMock.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7