-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds test for the isAchievement method
- Loading branch information
Antonis Lilis
committed
Apr 26, 2024
1 parent
49035a2
commit d1e527a
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
WordPress/src/test/java/org/wordpress/android/models/NoteExtensionsTest.kt
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.wordpress.android.models | ||
|
||
import kotlinx.coroutines.ExperimentalCoroutinesApi | ||
import org.junit.Test | ||
import org.mockito.kotlin.mock | ||
import org.mockito.kotlin.whenever | ||
import org.wordpress.android.BaseUnitTest | ||
import kotlin.test.assertFalse | ||
import kotlin.test.assertTrue | ||
|
||
@ExperimentalCoroutinesApi | ||
class NoteExtensionsTest : BaseUnitTest() { | ||
@Test | ||
fun `A comment_like note is not an achievement note`(){ | ||
val note = mock<Note>() | ||
whenever(note.rawType).thenReturn("comment_like") | ||
val result = note.isAchievement() | ||
assertFalse(result) | ||
} | ||
|
||
@Test | ||
fun `A user_goal_met note is an achievement note`(){ | ||
val note = mock<Note>() | ||
whenever(note.rawType).thenReturn("user_goal_met") | ||
val result = note.isAchievement() | ||
assertTrue(result) | ||
} | ||
} |