EranBoudjnah/CleanArchitectureForAndroid

[question] use extension function for mapper

Closed this issue · 3 comments

Could I ask why you choose class which needed to init for mappers instead of extension functions like toPresentation or toData for models ?

idea may be it hard for implement TDD

Absolutely. The reason is that mocking extension functions is harder. While Mockk can do the job, it is slower than Mockito. I do not wish to exercise the mappers when I test the functions using them. This makes pinning down bugs easier.

thank for dedicate answer