TestInterceptor
public class TestInterceptor<State> : Interceptor
An Interceptor
to use in unit tests, to assert specific Action
s are dispatched.
-
Initializes the
TestInterceptor
.Declaration
Swift
public init()
-
Declaration
Swift
public func actionDispatched(action: Action, oldState: State, newState: State)
-
Waits for the expected number of
Action
s to be intercepted. If the expected number ofAction
s are not intercepted before the timout an error is thrown.Declaration
Swift
public func waitForActions(expectedNumberOfActions: Int, timeout: TimeInterval = 1) throws
Parameters
expectedNumberOfActions
The number of
Action
s to wait fortimeout
The waiting time before failing (in seconds)