mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Modularize more models/utils (#3182)
This commit is contained in:
parent
5bb3f73e0d
commit
4eba3e9daf
80 changed files with 656 additions and 629 deletions
|
|
@ -23,6 +23,9 @@ import org.junit.After
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.meshtastic.core.model.MeshUser
|
||||
import org.meshtastic.core.model.NodeInfo
|
||||
import org.meshtastic.core.model.Position
|
||||
import java.util.Locale
|
||||
|
||||
class NodeInfoTest {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package com.geeksville.mesh
|
|||
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
import org.meshtastic.core.model.Position
|
||||
|
||||
class PositionTest {
|
||||
@Test
|
||||
|
|
@ -35,5 +36,4 @@ class PositionTest {
|
|||
val position = Position(37.1, 121.1, 35)
|
||||
Assert.assertTrue(position.time != 0)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@
|
|||
|
||||
package com.geeksville.mesh.model
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.meshtastic.core.model.DeviceVersion
|
||||
|
||||
class DeviceVersionTest {
|
||||
/** make sure we match the python and device code behavior */
|
||||
@Test
|
||||
fun canParse() {
|
||||
|
||||
assertEquals(10000, DeviceVersion("1.0.0").asInt)
|
||||
assertEquals(10101, DeviceVersion("1.1.1").asInt)
|
||||
assertEquals(12357, DeviceVersion("1.23.57").asInt)
|
||||
assertEquals(12357, DeviceVersion("1.23.57.abde123").asInt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ package com.geeksville.mesh.ui.metrics
|
|||
|
||||
import com.geeksville.mesh.TelemetryProtos
|
||||
import com.geeksville.mesh.copy
|
||||
import com.geeksville.mesh.util.UnitConversions.celsiusToFahrenheit
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.meshtastic.core.model.util.UnitConversions.celsiusToFahrenheit
|
||||
|
||||
class EnvironmentMetricsTest {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue