InitSpec

class InitSpec<M, F>(init: Init<M, F>)

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

Parameters

M

model type

F

effects type

Constructors

Link copied to clipboard
constructor(init: Init<M, F>)

Types

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

Interface for defining your assertions over First 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 AssertError implementation. If no exceptions are thrown by the function under test, then an AssertError will be thrown to fail the test.

Functions

Link copied to clipboard
fun whenInit(model: M): InitSpec.Then<M, F>