July 2018
Intermediate to advanced
242 pages
8h 6m
English
Often when writing unit test cases for complex classes, we face the problem of instantiating a great number of properties that the class we want to test depends on. Although this problem could be solved with dependency injection, it is faster, more efficient, and more desirable to mock a behavior of a specific object without instantiating it at all. In this recipe, we are going to explore how to use the Mockito Kotlin library to mock dependencies when writing a unit test for a simple registration form that contains an internal dependency whose behavior we are going to mock.
Read now
Unlock full access