icedream / go-footballdata

Golang interface allowing to communicate with the Football-Data API to process football/soccer match information.
19 stars 6 forks source link

Unit testing through API server mocking? #3

Open icedream opened 8 years ago

icedream commented 8 years ago

Currently I'm working on implementing unit/integration testing for this library by mocking the API server with test data.

The easiest and probably most suitable solution I've come up with so far is by supplying the test data in form of a data file (JSON/YAML/XML) and then set up the HTTP server to generate its output from the supplied data (the test data should not contain duplicate data, for example multiple listings of the same fixture in different query contexts).

icedream commented 6 years ago

As a note, this would have prevented our issue with the transition mentioned in #8. We should get this working as soon as we gain access back... argh.