mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: coroutine dispatchers and modernize testing infrastructure (#4901)
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Some checks are pending
Dependency Submission / dependency-submission (push) Waiting to run
Main CI (Verify & Build) / validate-and-build (push) Waiting to run
Main Push Changelog / Generate main push changelog (push) Waiting to run
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
664ebf218e
commit
96060a0a4d
36 changed files with 621 additions and 182 deletions
|
|
@ -129,8 +129,8 @@ class CompassViewModelTest {
|
|||
}
|
||||
|
||||
// Bearing from (0,0) to (1,1) is approx 45 degrees
|
||||
assertEquals(45f, state.bearing!!, 0.5f)
|
||||
assertEquals(0f, state.heading!!, 0.1f)
|
||||
assertEquals(45f, state.bearing, 0.5f)
|
||||
assertEquals(0f, state.heading, 0.1f)
|
||||
assertTrue(state.hasTargetPosition)
|
||||
|
||||
cancelAndIgnoreRemainingEvents()
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
|
|||
import kotlinx.coroutines.test.StandardTestDispatcher
|
||||
import kotlinx.coroutines.test.TestScope
|
||||
import org.meshtastic.core.model.Node
|
||||
import org.meshtastic.core.model.RadioController
|
||||
import org.meshtastic.core.repository.NodeRepository
|
||||
import org.meshtastic.core.repository.ServiceRepository
|
||||
import org.meshtastic.core.testing.FakeNodeRepository
|
||||
import org.meshtastic.core.testing.FakeRadioController
|
||||
import org.meshtastic.core.ui.util.AlertManager
|
||||
import org.meshtastic.proto.User
|
||||
import kotlin.test.Test
|
||||
|
|
@ -34,9 +34,9 @@ import kotlin.test.Test
|
|||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class NodeManagementActionsTest {
|
||||
|
||||
private val nodeRepository = mock<NodeRepository>(MockMode.autofill)
|
||||
private val nodeRepository = FakeNodeRepository()
|
||||
private val serviceRepository = mock<ServiceRepository>(MockMode.autofill)
|
||||
private val radioController = mock<RadioController>(MockMode.autofill)
|
||||
private val radioController = FakeRadioController()
|
||||
private val alertManager = mock<AlertManager>(MockMode.autofill)
|
||||
private val testDispatcher = StandardTestDispatcher()
|
||||
private val testScope = TestScope(testDispatcher)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue