nyanimedb/api/_build/my-cpp-templates/cpp-restsdk/api-gmock.mustache
Kirill 20cf8b1fc2 build(tgbot-gen): Changes and additions required to generate the API client with auth (cookie)
I use a standard set of templates, changes are made in api-header.mustache and api-source.mustache. Their _old versions contain the originals. Additions are necessary for the header argument in the generated functions so that you can authenticate using cookies.
2025-12-05 22:49:14 +03:00

41 lines
1.1 KiB
Text

{{>licenseInfo}}
{{#operations}}
#ifndef {{apiHeaderGuardPrefix}}_{{classname}}GMock_H_
#define {{apiHeaderGuardPrefix}}_{{classname}}GMock_H_
#include <gmock/gmock.h>
#include "{{classname}}.h"
{{#apiNamespaceDeclarations}}
namespace {{this}} {
{{/apiNamespaceDeclarations}}
using namespace {{modelNamespace}};
class {{declspec}} {{classname}}Mock : public I{{classname}}
{
public:
using Base = I{{classname}};
{{classname}}Mock() = default;
explicit {{classname}}Mock( std::shared_ptr<ApiClient> apiClient ) { };
~{{classname}}Mock() override = default;
{{#operation}}
MOCK_METHOD{{allParams.size}}( {{operationId}}, pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> (
{{#allParams}}
{{^required}}boost::optional<{{/required}}{{#isFile}}std::shared_ptr<{{/isFile}}{{{dataType}}}{{#isFile}}>{{/isFile}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}}
{{/allParams}}
) );
{{/operation}}
};
{{#apiNamespaceDeclarations}}
}
{{/apiNamespaceDeclarations}}
#endif /* {{apiHeaderGuardPrefix}}_{{classname}}GMock_H_ */
{{/operations}}