Commit 06be1d3c authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update UserAvatarHelperTest.kt

parent 1795b974
import chat.rocket.android.widget.helper.UserAvatarHelper
import org.junit.Test
import kotlin.test.assertEquals
class UserAvatarHelperTest {
@Test
fun getUsernameInitialsTest() {
assert(UserAvatarHelper.getUsernameInitials("") == "?")
assert(UserAvatarHelper.getUsernameInitials("?") == "?")
assert(UserAvatarHelper.getUsernameInitials("f") == "F")
assert(UserAvatarHelper.getUsernameInitials("B") == "B")
assert(UserAvatarHelper.getUsernameInitials("fo") == "FO")
assert(UserAvatarHelper.getUsernameInitials("FO") == "FO")
assert(UserAvatarHelper.getUsernameInitials("fOo") == "FO")
assert(UserAvatarHelper.getUsernameInitials("FOO") == "FO")
assert(UserAvatarHelper.getUsernameInitials("F.O") == "FO")
assert(UserAvatarHelper.getUsernameInitials("F.o") == "FO")
assert(UserAvatarHelper.getUsernameInitials("Foo.bar") == "FB")
assert(UserAvatarHelper.getUsernameInitials("Foobar.bar") == "FB")
assert(UserAvatarHelper.getUsernameInitials("Foobar.bar.zab") == "FZ")
assert(UserAvatarHelper.getUsernameInitials("..") == "..")
assert(UserAvatarHelper.getUsernameInitials("...") == "..")
assert(UserAvatarHelper.getUsernameInitials(".Foo.") == ".F")
assert(UserAvatarHelper.getUsernameInitials("Foo..") == "FO")
assertEquals("?", UserAvatarHelper.getUsernameInitials(""))
assertEquals("?", UserAvatarHelper.getUsernameInitials("?"))
assertEquals("F", UserAvatarHelper.getUsernameInitials("f"))
assertEquals("B", UserAvatarHelper.getUsernameInitials("B"))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("Fo"))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("FO"))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("fOo"))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("FOO"))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("F.O"))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("F.o"))
assertEquals("FB", UserAvatarHelper.getUsernameInitials("Foo.bar"))
assertEquals("FB", UserAvatarHelper.getUsernameInitials("Foobar.bar"))
assertEquals("FZ", UserAvatarHelper.getUsernameInitials("Foobar.bar.zab"))
assertEquals("..", UserAvatarHelper.getUsernameInitials(".."))
assertEquals("..", UserAvatarHelper.getUsernameInitials("..."))
assertEquals(".F", UserAvatarHelper.getUsernameInitials(".Foo."))
assertEquals("FO", UserAvatarHelper.getUsernameInitials("Foo.."))
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment