ekinhbayar / gitamp

Listen to music generated by events across github.
MIT License
29 stars 10 forks source link

Unit tests #21

Closed ekinhbayar closed 7 years ago

ekinhbayar commented 7 years ago

Includes coding style fixes along with Client/RequestTest and Storage/RedisCounterTest so far. @PeeHaa, would you please review and hint me on what else you think needs to be tested? :-)

PeeHaa commented 7 years ago

I messed up the review I think. I started a review, but accidentally click "single comment" and my review was turned into separate comments. :-(

I've also added some comments on "outdated" commits which should still be checked.

PeeHaa commented 7 years ago

@ekinhbayar I have fixed the GitAmp tests https://gist.github.com/PeeHaa/796068f5e3b3e4c160e6dedf079dd5f2.

It now uses mocks which has several benefits:

The same idea applies to the RedisCounter test. Instead of relying on redis being available. And running non isolated tests which also include amp/redis we can instead use a mock RedisClient without ever going through the amp/redis stack or ever sending actually things over to a redis server.

I didn't write the redis tests yet, because I thought you may want to try to rewrite them using mocks.