Search code examples
iosswiftunit-testing

Unit Testing with Viper - Swift & iOS


Unit testing with Viper - Swift

Hello,

I have an Login module(LoginViewController,LoginPresenter,LoginInteractor,LoginRouter) that I wrote with Viper. I want to write a unit test for this module but I'm not sure exactly where to start. Can I get suggestions from people who write unit tests with Viper? Thank you,


Solution

  • You could start by learning about dependency injection and how it can be useful for testing your module layers. Then you can explore the concept of test doubles. These are the main concepts that helped me a lot in the beginning.

    Here are some useful links:

    Dependency Injection

    Test doubles