-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(repository): add test for flags repository (#28)
- Loading branch information
1 parent
f7810d6
commit 603ce18
Showing
5 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
38 changes: 38 additions & 0 deletions
38
core-repository/tests/src/jvmMain/kotlin/repository/FlagsRepositoryTest.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,38 @@ | ||
package repository | ||
|
||
import kotlin.test.Test | ||
|
||
class FlagsRepositoryTest { | ||
|
||
private val sut = FlagsRepository() | ||
|
||
@Test | ||
fun givenRepositoryWhenItLanguageFlagIsQueriedThenCorrectFlagIsReturned() { | ||
val res = sut.getFlag("it") | ||
assert(res == "\uD83C\uDDEE\uD83C\uDDF9") | ||
} | ||
|
||
@Test | ||
fun givenRepositoryWhenDeLanguageFlagIsQueriedThenCorrectFlagIsReturned() { | ||
val res = sut.getFlag("de") | ||
assert(res == "\uD83C\uDDE9\uD83C\uDDEA") | ||
} | ||
|
||
@Test | ||
fun givenRepositoryWhenFrLanguageFlagIsQueriedThenCorrectFlagIsReturned() { | ||
val res = sut.getFlag("fr") | ||
assert(res == "\uD83C\uDDEB\uD83C\uDDF7") | ||
} | ||
|
||
@Test | ||
fun givenRepositoryWhenElLanguageFlagIsQueriedThenCorrectFlagIsReturned() { | ||
val res = sut.getFlag("el") | ||
assert(res == "\uD83C\uDDEC\uD83C\uDDF7") | ||
} | ||
|
||
@Test | ||
fun givenRepositoryWhenUnknownLanguageFlagIsQueriedThenDefaultFlagIsReturned() { | ||
val res = sut.getFlag("xx") | ||
assert(res == "\uD83C\uDDEC\uD83C\uDDE7") | ||
} | ||
} |