-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [#274] initial setup test using JUnit & MockK
- Loading branch information
1 parent
9821c9e
commit d95dd48
Showing
2 changed files
with
29 additions
and
0 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
25 changes: 25 additions & 0 deletions
25
app/src/test/java/com/breadwallet/tools/util/LocaleHelperTest.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,25 @@ | ||
package com.breadwallet.tools.util | ||
|
||
import android.content.Context | ||
import com.breadwallet.entities.Language | ||
import io.mockk.mockk | ||
import org.junit.Assert.assertEquals | ||
import org.junit.Assert.assertTrue | ||
import org.junit.Test | ||
|
||
class LocaleHelperTest { | ||
|
||
@Test | ||
fun `given LocaleHelper instance, then should validate default value`() { | ||
val context: Context = mockk(relaxed = true) | ||
|
||
LocaleHelper.init(context) | ||
|
||
val currentLocale = LocaleHelper.instance.currentLocale | ||
|
||
assertTrue(currentLocale == Language.ENGLISH) | ||
assertEquals("en", currentLocale.code) | ||
assertEquals("English", currentLocale.title) | ||
assertEquals("Select language", currentLocale.desc) | ||
} | ||
} |