Skip to content

feat(dapi): support mocks in rs-dapi-client - #1417

Merged
lklimek merged 20 commits into
rs-sdk/read-document-identity-contractfrom
rs-sdk/rs-dapi-client-mocks
Oct 11, 2023
Merged

lklimek merged 20 commits into
rs-sdk/read-document-identity-contractfrom
rs-sdk/rs-dapi-client-mocks

Conversation

@lklimek

@lklimek lklimek commented Sep 20, 2023 •

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

To write tests for things like from_proof or rs-sdk, we need a way to mock rs-dapi-client..

What was done?

  • DapiClient now implements pub trait Dapi
  • Added MockDapiClient that implements pub trait Dapi
  • users can mock requests/responses using MockDapiClient::expect
  • Added Expectations type that is used both by MockDapiClient and by rs_sdk mocks

How Has This Been Tested?

Unit test

Breaking Changes

N/A.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@lklimek
lklimek force-pushed the rs-sdk/rs-dapi-client-mocks branch from 642127b to d2590b7 Compare September 28, 2023 09:54
Comment thread packages/rs-dapi-client/src/mock.rs Resolved
@lklimek
lklimek requested a review from fominok October 4, 2023 08:25
@shumkov shumkov changed the title feat(rs-sdk): support mocks in rs-dapi-client feat(sdk): support mocks in rs-dapi-client Oct 4, 2023
@shumkov shumkov changed the title feat(sdk): support mocks in rs-dapi-client feat(dapi): support mocks in rs-dapi-client Oct 4, 2023
@lklimek
lklimek force-pushed the rs-sdk/rs-dapi-client-mocks branch from f2c3f39 to e89c156 Compare October 10, 2023 16:54
@lklimek
lklimek merged commit 7b88ba2 into rs-sdk/read-document-identity-contract Oct 11, 2023
@lklimek
lklimek deleted the rs-sdk/rs-dapi-client-mocks branch October 11, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants