Then

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.

Functions

Link copied to clipboard
abstract fun then(assertion: UpdateSpec.Assert<M, F>)

Runs the specified test and then invokes the Assert on the Result.

Link copied to clipboard
abstract fun thenError(assertion: UpdateSpec.AssertError)

Runs the specified test and validates that the last step throws the exception expected by the supplied AssertError. Note that if the test specification has multiple events, it will fail if the exception is thrown before the execution of the last event.