skip to Main Content

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,

2

Answers


  1. In [PROJECTNAME]Tests folder, create Unit Test Case Class file and follow the particular architecture (not necessary). Write test cases in that file and XCode supports is enough for you to easily understand whole process.

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search