1#ifndef TENDUKE_TEST_MOCKS_JSONOBJECTMOCK_H
2#define TENDUKE_TEST_MOCKS_JSONOBJECTMOCK_H
4#include "json/JSONObject.h"
5#include "gmock/gmock.h"
7namespace tenduke {
namespace test {
namespace mocks {
13 MOCK_METHOD(
enum Type,
getType, (), (
const,
override));
14 MOCK_METHOD(std::string,
asString, (), (
const,
override));
17 MOCK_METHOD(std::shared_ptr<tenduke::json::JSONElement>,
getProperty, (
const std::string &a), (
const,
override));
18 MOCK_METHOD(
bool,
hasProperty, (
const std::string &a), (
const,
override));
19 MOCK_METHOD(std::shared_ptr<tenduke::json::JSONElement>,
removeProperty, (
const std::string &a), (
override));
21 MOCK_METHOD((
const std::map<std::string, std::shared_ptr<tenduke::json::JSONElement>> &),
getProperties, (), (
const,
override));
23 std::map<std::string, std::shared_ptr<tenduke::json::JSONElement>> properties;
28 EXPECT_CALL(*mock,
getType()).WillRepeatedly(::testing::Return(tenduke::json::JSONElement::Type::OBJECT));
32 static std::unique_ptr<JSONObjectMock> createUnique()
34 return std::unique_ptr<JSONObjectMock>(create());
36 static std::shared_ptr<JSONObjectMock> createShared()
38 return std::shared_ptr<JSONObjectMock>(create());
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
JSON object element.
Definition JSONObject.h:16
virtual std::shared_ptr< JSONElement > removeProperty(const std::string &propertyName)=0
Removes property from this object.
virtual const std::map< std::string, std::shared_ptr< JSONElement > > & getProperties() const =0
Returns all properties of this object.
virtual bool hasProperty(const std::string &propertyName) const =0
Checks if the object has a property with given name.
virtual std::shared_ptr< JSONElement > getProperty(const std::string &propertyName) const =0
Returns object property by name.
Definition JSONObjectMock.h:10
Root for classes, functions and globals of 10Duke C++ Client.
Definition APIRequest.h:4