antoniolg / Bandhook-Kotlin

A showcase music app for Android entirely written using Kotlin language
Apache License 2.0
1.86k stars 398 forks source link

Unit Tests Fix #27

Closed mabdurrahman closed 7 years ago

mabdurrahman commented 7 years ago

Fixed Retrofit 2 service mocking having invalid return type in Unit Tests, it was implemented to return the expected deserialized response directly, however, it should return a Retrofit Call<?> type of the response, thus I pulled a Fake implementation of Retrofit Call<?> (from: https://github.com/square/retrofit/blob/master/retrofit-mock/src/main/java/retrofit2/mock/Calls.java) where it's initialized using either a Response (i.e. success, error) or IOException to simulate network issues if required

antoniolg commented 7 years ago

thanks for this!

mabdurrahman commented 7 years ago

sure, we actually learned from you, so thank you!