Google APIs Client Library for C++
|
Mock http request for testing GMock. More...
#include "client/transport/test/mock_http_transport.h"
Public Types | |
typedef Callback1< HttpResponse * > | DoExecuteCallback |
Public Member Functions | |
MockHttpRequest (HttpRequest::HttpMethod method, HttpTransport *transport) | |
MOCK_METHOD1 (DoExecute, void(HttpResponse *response)) | |
void | poke_http_code (int code) |
void | poke_transport_status (util::Status status) |
void | poke_response_header (const StringPiece name, const StringPiece value) |
void | poke_response_body (const string &body) |
const string | content_as_string () |
Testing convienence method for checking the content_reader() value. | |
const string | response_body_as_string () |
Testing convienence method for checking the response body_reader() value. | |
void | CheckHeader (const StringPiece &name, const string &value) |
Testing convienence method added to check header values. |
Mock http request for testing GMock.
typedef Callback1<HttpResponse*> DoExecuteCallback |
MockHttpRequest | ( | HttpRequest::HttpMethod | method, |
HttpTransport * | transport | ||
) | [inline] |
void CheckHeader | ( | const StringPiece & | name, |
const string & | value | ||
) | [inline] |
Testing convienence method added to check header values.
Fails if the header was not present or value does not match.
[in] | name | Header to check |
[in] | value | Value to confirm |
const string content_as_string | ( | ) | [inline] |
Testing convienence method for checking the content_reader() value.
This method will rewind the reader if it had already been called so is safe to grab multiple values.
MOCK_METHOD1 | ( | DoExecute | , |
void(HttpResponse *response) | |||
) |
void poke_http_code | ( | int | code | ) | [inline] |
void poke_response_body | ( | const string & | body | ) | [inline] |
void poke_response_header | ( | const StringPiece | name, |
const StringPiece | value | ||
) | [inline] |
void poke_transport_status | ( | util::Status | status | ) | [inline] |
const string response_body_as_string | ( | ) | [inline] |
Testing convienence method for checking the response body_reader() value.
This method will rewind the reader if it had already been called so is safe to grab multiple values.