forTransformer

Creates a new TransmissionTest instance for testing the specified transformer.

This is the primary factory method for creating test instances. The test will use UnconfinedTestDispatcher by default for immediate execution of coroutines.

Return

A new TransmissionTest instance

Example:

val test = TransmissionTest.forTransformer(UserTransformer())
test.testSignal(UserSignal.Login("user", "pass")) { /* assertions */}

Parameters

transformer

The transformer to test


fun forTransformer(transformer: Transformer, dispatcher: TestDispatcher): TransmissionTest

Creates a new TransmissionTest instance for testing the specified transformer with a custom dispatcher.

This method allows you to control coroutine execution timing by providing a custom test dispatcher. This can be useful for testing time-dependent behavior or controlling execution order.

Return

A new TransmissionTest instance

Example:

val testDispatcher = StandardTestDispatcher()
val test = TransmissionTest.forTransformer(UserTransformer(), testDispatcher)
test.testSignal(UserSignal.DelayedOperation) {
// Use testDispatcher.scheduler.advanceTimeBy() to control timing
}

Parameters

transformer

The transformer to test

dispatcher

The test dispatcher to use for coroutine execution