UITestResponse
public final class UITestResponse : StubResponse
The UITestResponse
is the base response for UITestServer
. It contains methods to send
the response data to the Local Server.
This type also provides support to the concept of states for simulating Stateful behaviors
- Basics: http://orca.st.usm.edu/~seyfarth/network_pgm/net-6-3-3.html
- Concept: https://en.wikipedia.org/wiki/State_(computer_science)
The response can be tied to a initial state and be connected to a next state, creating a state chain if needed.
-
This function must be called after creating and providing all the information to a response object. It’ll process the information internally in the local server and prepare it to be used in the main application.
Declaration
Swift
public func send(to endPoint: String)
Parameters
endPoint
Defines the endPoint pattern matching for this response.
-
Defines the initial state for this response. It means this response will not take effect unless its initial state is reached by some other response. When no initial state is defined it means the response will be at the root of the state chain.
The states are grouped by the endPoint pattern defined by
send(to:)
Declaration
Swift
public func whenStateIs(_ startingState: String) -> Self
Parameters
startingState
The state in which this response will start taking effect.
Return Value
The same response object with a new initial state.
-
Defines the output state for this response. If no end state is defined the endpoint pattern it’s attached to will keep the previous state.
The states are grouped by the endPoint pattern defined by
send(to:)
Declaration
Swift
public func willSetStateTo(_ finishingState: String) -> Self
Parameters
finishingState
The state in which this response will ends at.
Return Value
The same response object with a new initial state.