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, asJSON, (), (const, override));
14 MOCK_METHOD(std::string, asString, (), (const, override));
15 MOCK_METHOD(bool, getValue, (), (const, override));
16
17 static std::shared_ptr<JSONBooleanMock> createShared(const bool value)
18 {
19 auto element = std::make_shared<JSONBooleanMock>();
20 EXPECT_CALL(*element, getType()).WillRepeatedly(::testing::Return(JSONBoolean::BOOLEAN));
21 EXPECT_CALL(*element, getValue()).WillRepeatedly(::testing::Return(value));
22 EXPECT_CALL(*element, asString()).WillRepeatedly(::testing::Return(value ? "true" : "false"));
23
24 return element;
25 }
26};
27
28}}}
29
30#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
Gets the value of the element as a string.
virtual std::string asJSON() const =0
Serializes the element as JSON.
Type
Type of the element.
Definition JSONElement.h:17
Definition JSONBooleanMock.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition AbstractClientFactory.h:16