![]() ![]() Now, we assign the result to a actualResult variable from We actually are mocking the Utility class file at the runtime.įrom Utility class and returning the result. In the above means that the function can be exectuted as a test. Now, to start its local unit testing, we need to create a file called We will create a file which we are going to test called Utility.ktįunction which takes two integer parameter and returns it's sum. Src -> main -> java -> apps_package_name, TestImplementation 'org.mockito:mockito-core:2.19.0' So, before delay let me get started.īut, Firstly let me help you start with a small example of using Mockito.To integrate Mockito in our project we will add the following in our app's Why is this an issue, which made me write a blog on it. ![]() In this blog, I will talk about using Mockito to test final classes in Kotlin. ![]()
0 Comments
Leave a Reply. |