chore: remove `MeshServiceTest`

pull/1233/head
andrekir 2024-09-08 08:33:39 -03:00
rodzic 8be6d74ed8
commit a916871596
2 zmienionych plików z 1 dodań i 29 usunięć

Wyświetl plik

@ -1053,7 +1053,7 @@ class MeshService : Service(), Logging {
val rxTime = if (packet.rxTime != 0) packet.rxTime else currentSecond()
// Update our last seen based on any valid timestamps. If the device didn't provide a timestamp make one
updateNodeInfoTime(it, rxTime)
it.lastHeard = rxTime
it.snr = packet.rxSnr
it.rssi = packet.rxRssi
@ -1997,7 +1997,3 @@ class MeshService : Service(), Logging {
}
}
}
fun updateNodeInfoTime(it: NodeInfo, rxTime: Int) {
it.lastHeard = rxTime
}

Wyświetl plik

@ -1,24 +0,0 @@
package com.geeksville.mesh.service
import com.geeksville.mesh.MeshProtos
import com.geeksville.mesh.MeshUser
import com.geeksville.mesh.NodeInfo
import com.geeksville.mesh.Position
import org.junit.Assert
import org.junit.Test
class MeshServiceTest {
val model = MeshProtos.HardwareModel.ANDROID_SIM
val nodeInfo = NodeInfo(4, MeshUser("+one", "User One", "U1", model), Position(37.1, 121.1, 35, 10))
@Test
fun givenNodeInfo_whenUpdatingWithNewTime_thenPositionTimeIsUpdated() {
val newerTime = 20
updateNodeInfoTime(nodeInfo, newerTime)
Assert.assertEquals(newerTime, nodeInfo.lastHeard)
}
}