10Duke Scale C++ Client
Loading...
Searching...
No Matches
JSONArrayMock.h
1#ifndef TENDUKE_TEST_MOCKS_JSONARRAYMOCK_H
2#define TENDUKE_TEST_MOCKS_JSONARRAYMOCK_H
3
4#include "json/JSONArray.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, isEmpty, (), (const, override));
15 MOCK_METHOD(std::size_t, getSize, (), (const, override));
16 MOCK_METHOD((const std::vector<std::shared_ptr<JSONElement>> &) , getValues, (), (const, override));
17
18 static JSONArrayMock * create()
19 {
20 auto mock = new JSONArrayMock();
21 EXPECT_CALL(*mock, getType()).WillRepeatedly(::testing::Return(tenduke::json::JSONElement::Type::ARRAY));
22
23 return mock;
24 }
25
26 static std::shared_ptr<JSONArrayMock> createShared()
27 {
28 return std::shared_ptr<JSONArrayMock>(create());
29 }
30
31};
32
33}}}
34
35#endif //TENDUKE_TEST_MOCKS_JSONARRAYMOCK_H
A JSON array.
Definition JSONArray.h:16
virtual std::size_t getSize() const =0
Returns number of elements in the array.
virtual bool isEmpty() const =0
Checks if the array is empty.
virtual const std::vector< std::shared_ptr< JSONElement > > & getValues() const =0
Returns the elements of the array.
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 JSONArrayMock.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition BackendConfiguration.h:7