mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-02-08 23:02:58 -05:00
refactor: convert ChannelSet to protobuf extensions
This commit is contained in:
@@ -2,7 +2,9 @@ package com.geeksville.mesh
|
||||
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import com.geeksville.mesh.model.Channel
|
||||
import com.geeksville.mesh.model.ChannelSet
|
||||
import com.geeksville.mesh.model.URL_PREFIX
|
||||
import com.geeksville.mesh.model.getChannelUrl
|
||||
import com.geeksville.mesh.model.toChannelSet
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
@@ -11,10 +13,14 @@ import org.junit.runner.RunWith
|
||||
class ChannelTest {
|
||||
@Test
|
||||
fun channelUrlGood() {
|
||||
val ch = ChannelSet()
|
||||
val ch = channelSet {
|
||||
settings.add(Channel.default.settings)
|
||||
loraConfig = Channel.default.loraConfig
|
||||
}
|
||||
val channelUrl = ch.getChannelUrl()
|
||||
|
||||
Assert.assertTrue(ch.getChannelUrl().toString().startsWith(ChannelSet.prefix))
|
||||
Assert.assertEquals(ChannelSet(ch.getChannelUrl()), ch)
|
||||
Assert.assertTrue(channelUrl.toString().startsWith(URL_PREFIX))
|
||||
Assert.assertEquals(channelUrl.toChannelSet(), ch)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user