TMDbLib icon indicating copy to clipboard operation
TMDbLib copied to clipboard

Mock server responses in Unit Tests

Open LordMike opened this issue 6 years ago • 1 comments

Allow us to mock responses using preconfigured results, so that we can continually test the library.

We could do:

  • A switch in the Unit Tests that either read from, or write to, the mocked responses collection / file (Allows us to update the mocked data)
    • We'd also be able to run without mocked data, recording all results, and then quickly in Git diff identifying if any remote endpoint has changed its response layout
  • A response should work for multiple different requests, so we'll need a way to identify which response to use (matching on url + parameters?)

LordMike avatar Jan 23 '19 18:01 LordMike

  • https://github.com/richardszalay/mockhttp
  • https://github.com/WireMock-Net/WireMock.Net

LordMike avatar Jan 23 '19 20:01 LordMike