fix: update unit tests

master
andrekir 2023-01-26 22:41:12 -03:00
rodzic 9ea6dff385
commit 1e504a8703
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
package com.geeksville.mesh
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.geeksville.mesh.model.Channel
import com.geeksville.mesh.model.ChannelSet
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
@ -10,9 +10,9 @@ import org.junit.runner.RunWith
class ChannelTest {
@Test
fun channelUrlGood() {
val ch = Channel.emulated
val ch = ChannelSet()
Assert.assertTrue(ch.getChannelUrl().toString().startsWith(Channel.prefix))
Assert.assertEquals(Channel(ch.getChannelUrl()), ch)
Assert.assertTrue(ch.getChannelUrl().toString().startsWith(ChannelSet.prefix))
Assert.assertEquals(ChannelSet(ch.getChannelUrl()), ch)
}
}

Wyświetl plik

@ -13,10 +13,10 @@ class UIUnitTest {
@Test
fun initialsGood() {
Assert.assertEquals("KH", getInitials("Kevin Hester"))
Assert.assertEquals("KHL", getInitials(" Kevin Hester Lesser Cat "))
Assert.assertEquals("KHLC", getInitials(" Kevin Hester Lesser Cat "))
Assert.assertEquals("", getInitials(" "))
Assert.assertEquals("gks", getInitials("geeksville"))
Assert.assertEquals("gee", getInitials("geek"))
Assert.assertEquals("gks", getInitials("geeks"))
Assert.assertEquals("gksv", getInitials("geeksville"))
Assert.assertEquals("geek", getInitials("geek"))
Assert.assertEquals("gks1", getInitials("geeks1"))
}
}