TestDataFactory

Factory for creating test domain objects.

Provides sensible defaults that can be overridden for specific test needs.

Functions

Link copied to clipboard
fun createMyNodeInfo(myNodeNum: Int = 1, hasGPS: Boolean = false, model: String? = "TBEAM", firmwareVersion: String? = "2.5.0", hasWifi: Boolean = false, pioEnv: String? = null): MyNodeInfo

Creates a test MyNodeInfo with default values.

Link copied to clipboard
fun createTestNode(num: Int = 1, userId: String = "!test0001", longName: String = "Test User", shortName: String = "T", lastHeard: Int = 0, hwModel: HardwareModel = org.meshtastic.proto.HardwareModel.UNSET, batteryLevel: Int? = 100): Node

Creates a test Node with default values.

Link copied to clipboard
fun createTestNodes(count: Int, baseNum: Int = 1): List<Node>

Creates multiple test nodes with sequential IDs.

Link copied to clipboard
fun createTestPacket(from: Int = 1, to: Int = 0xffffffff.toInt(), decoded: Data? = null, relayNode: Int = 0): MeshPacket

Creates a test org.meshtastic.proto.MeshPacket with default values.