UpdateSpec

class UpdateSpec<M, E, F>(update: Update<M, E, F>)

A class to help with Behavior Driven Testing of the Update function of a Mobius program.

Parameters

M

model type

E

events type

F

effects type

Constructors

Link copied to clipboard
constructor(update: Update<M, E, F>)

Types

Link copied to clipboard
fun interface Assert<M, F>

Interface for defining your assertions over Next instances.

Link copied to clipboard
fun interface AssertError

Interface for defining your error assertions.

Link copied to clipboard
object Companion
Link copied to clipboard
interface Then<M, F>

The final step in a behavior test. Instances of this class will call your function under test with the previously provided values (i.e. given and when) and will pass the result of the function over to your Assert implementation. If you choose to call thenError, your function under test will be invoked and any exceptions thrown will be caught and passed on to your AssertionError implementation. If no exceptions are thrown by the function under test, then an AssertionError will be thrown to fail the test.

Link copied to clipboard
inner class When

Functions

Link copied to clipboard
fun given(model: M): UpdateSpec.When<M, E, F>