projectgoav/E.Deezer

Unit Testing

Opened this issue · 4 comments

Unit Testing

@projectgoav Maybe we can create new deezer account for unit test purpose? I thing that would be easy way to cover all methods with tests...

I did some work a long time ago on mocking out the API to return fake data but never continued. Working working on some UI as a sample use of the library so might continue this once that's complete.

Performing tests against the real API is difficult as without logging in the calls are rate limited and the test would probably hit this value very quickly. There's no easy way to automate authentication on the public API Deezer provide

Hi!

I would like to help so I started to work on this issue. You can find my progress here (I will merge a few commits together after I finished):

https://github.com/PoLaKoSz/E.Deezer/tree/develop/clean-code

Can You give me some feedback about this solution?
Thank You!

📓Notes:

  • Found 2 bug while I wrote a few tests (this are the failing Unit tests)
  • Coverage changed (41.04% -> 48.05%)
  • Implemented a new approach which hopefully make the development and the testing more easy (mocking the server response)

Thanks for looking into this. When you feel ready, submit it as a PR and I'll give it a review! :)

Edit: I find it easier to review as a change-set rather than browse through the source files.