Module mock

Module mock 

Source
Expand description

Mock implementation of rs-dapi-client for testing

rs-dapi-client provides mocks feature that makes it possible to mock the transport layer. Core concept of the mocks is a MockDapiClient that mimics DapiClient behavior and allows to define expectations for requests and responses using MockDapiClient::expect function.

In order to use the mocking feature, you need to:

  1. Define your requests and responses.
  2. Create a MockDapiClient and use it instead of DapiClient in your tests.

See tests/mock_dapi_client.rs for an example.

Structs§

Key
Unique identifier of some serializable object (e.g. request) that can be used as a key in a hashmap.
MockDapiClient
Mock DAPI client.

Enums§

MockError
Mock errors

Traits§

FromInner
Create full wrapping object from inner type, using defaults for fields that cannot be derived from the inner type.

Type Aliases§

MockResult
Result of executing a mock request