ActionsAssertScope

It is a core API for all assertions. It provides all actions dispatched with a spying component. If assertion verifies certain action, it is responsible for pulling it from unverified queue. Queue enforces verifying actions from the oldest to the latest. Verifying actions is expected behaviour of every assertion, but there are assertions that check certain conditions without pulling from the queue. Also, action might be skipped. It means that it is removed from unverified without assertion.

If you want to provide your own assertion check existing assertions source code.

Functions

Link copied to clipboard
abstract fun clearActionsHistory()

Clears history and unverified.

Properties

Link copied to clipboard
abstract val history: List<Action>

Contains all dispatched actions history.

Link copied to clipboard
abstract val unverified: Queue<Action>

Contains all unverified dispatched actions queue. If action is verified, it must be pulled from this queue.

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard

Returns a string that contains list of all dispatched actions. The action recently pulled form the queue is marked with '->'.

Link copied to clipboard

Asserts that first unverified action is equal to action.

Link copied to clipboard
inline fun <T : Action> ActionsAssertScope.assertActionOfType(assertions: (T) -> Unit = {})

Asserts that first unverified action is an instance of type T. Also, it applies additional assertions.

Link copied to clipboard

Asserts that there are only actions dispatched in given order and no more.

Link copied to clipboard

Asserts that all dispatched actions count is equal to count. It does not pull any action from unverified queue.

Link copied to clipboard
fun ActionsAssertScope.assertEveryAction(message: String? = null, predicate: (Action) -> Boolean)

Asserts that every unverified action matches the predicate.

Link copied to clipboard

Asserts that there is no dispatched actions.

Link copied to clipboard

Asserts that there is no unverified actions left.

Link copied to clipboard

Asserts that first unverified action is equal to action and it is the only one dispatched action.

Link copied to clipboard
inline fun <T : Action> ActionsAssertScope.assertSingleActionOfType(assertions: (T) -> Unit = {})

Asserts that first unverified action is an instance of T and it is the only one dispatched action. Also, it applies additional assertions.

Link copied to clipboard

Returns first unverified action.

Link copied to clipboard

Prints information about dispatched actions based on actionStackString.

Link copied to clipboard

Skips first n unverified actions.

Link copied to clipboard

Skips actions while predicate is true.

Link copied to clipboard

Skips first unverified action.

Link copied to clipboard

Skips all unverified actions.