A mock implementation of the networking::RequestSender interface for testing purposes. It is designed to support unit testing of components that rely on sending network requests by mocking the functionality of the RequestSender interface. It eliminates the need for actual network communication during tests, enabling controlled and reproducible test environments. More...
#include <RequestSender.hpp>
Public Member Functions | |
QMOCK (foundation::UniqueQtPtr< ReplyResponse >, get,(const ::QNetworkRequest &),()) | |
RequestSender (const foundation::QtPtr< QObject > &parent) | |
Fully initialises the object with a specified parent. | |
![]() | |
RequestSender (const foundation::QtPtr< QObject > &parent) | |
Fully initialises the object with a specified parent. | |
virtual foundation::UniqueQtPtr< ReplyResponse > | get (const QNetworkRequest &request)=0 |
When implemented, sends a GET request to the specified network address. | |
A mock implementation of the networking::RequestSender interface for testing purposes. It is designed to support unit testing of components that rely on sending network requests by mocking the functionality of the RequestSender interface. It eliminates the need for actual network communication during tests, enabling controlled and reproducible test environments.
The mock provides a customizable implementation for sending network requests and returning mocked responses, allowing precise control over the behavior and outputs of the request-sending process.
Usage:
Key Features:
get
method, enabling simulation of network interactions.drn::networking::testing::RequestSenderMock::QMOCK | ( | foundation::UniqueQtPtr< ReplyResponse > | , |
get | , | ||
(const ::QNetworkRequest &) | , | ||
() | ) |
|
explicit |
Fully initialises the object with a specified parent.
parent | The parent used to manage the memory and lifecycle of this instance, and ensuring it follows the Qt object hierarchy. |