[FEATURE] add ability to mock client calls #1

Closed
opened 2023-03-14 22:43:02 +03:00 by vtolstov · 1 comment
Owner
  • NewClient returns client.Client and mock.ClientMock

  • ClientMock have methods:

    • ExpectRequest(client.Request) *ExpectedRequest
    • ExpectationsWereMet() error
  • ExpectedRequest have methods:

    • WillDelayFor(time.Duration) - delay for amount of time before return result
    • WillReturnError(error) - return error for client Call
    • WillReturnResponse(interface{}) - return response
* NewClient returns client.Client and mock.ClientMock * ClientMock have methods: - ExpectRequest(client.Request) *ExpectedRequest - ExpectationsWereMet() error * ExpectedRequest have methods: - WillDelayFor(time.Duration) - delay for amount of time before return result - WillReturnError(error) - return error for client Call - WillReturnResponse(interface{}) - return response
Author
Owner

done

done
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: unistack-org/micro-client-mock#1
No description provided.