-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start to use Mockk instead of Mockito since is better prepared to be …
…used along with Kotlin
- Loading branch information
Showing
15 changed files
with
192 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,14 +28,14 @@ import com.owncloud.android.lib.resources.shares.GetRemoteShareesOperation | |
import com.owncloud.android.lib.resources.shares.ShareType | ||
import com.owncloud.android.presentation.sharing.sharees.OCShareeViewModel | ||
import com.owncloud.android.utils.AppTestUtil | ||
import io.mockk.every | ||
import io.mockk.mockkClass | ||
import junit.framework.Assert.assertEquals | ||
import org.json.JSONObject | ||
import org.junit.Rule | ||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
import org.junit.runners.JUnit4 | ||
import org.mockito.Mockito.`when` | ||
import org.mockito.Mockito.mock | ||
|
||
@RunWith(JUnit4::class) | ||
class OCShareeViewmodelTest { | ||
|
@@ -44,7 +44,7 @@ class OCShareeViewmodelTest { | |
val instantExecutorRule = InstantTaskExecutorRule() | ||
|
||
private var testAccount: Account = AppTestUtil.createAccount("admin@server", "test") | ||
private var ocShareeRepository: OCShareeRepository = mock(OCShareeRepository::class.java) | ||
private var ocShareeRepository: OCShareeRepository = mockkClass(OCShareeRepository::class) | ||
|
||
@Test | ||
fun loadSharees() { | ||
|
@@ -53,11 +53,11 @@ class OCShareeViewmodelTest { | |
AppTestUtil.createSharee("Group", ShareType.GROUP.value.toString(), "user2", "[email protected]") | ||
) | ||
|
||
`when`( | ||
every { | ||
ocShareeRepository.getSharees( | ||
"User", 1, 10 | ||
) | ||
).thenReturn(Resource.success(sharees)) | ||
} returns Resource.success(sharees) | ||
|
||
val ocShareeViewModel = createOCShareeViewModel(ocShareeRepository) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.