AsyncExpectation

public struct AsyncExpectation<Value> : Expectation

Undocumented

  • Undocumented

    Declaration

    Swift

    public let expression: Expression<Value>
  • The status of the test after predicates have been evaluated.

    This property can be used for changing test behavior based whether an expectation has passed.

    In the below example, we perform additional tests on an array only if it has enough elements.

    if expect(array).to(haveCount(10)).status == .passed {
       expect(array[9]).to(...)
    }
    

    Remark

    Similar functionality can be achieved using the onFailure(throw:) method.

    Declaration

    Swift

    public let status: ExpectationStatus
  • Undocumented

    Declaration

    Swift

    public init(expression: Expression<Value>)
  • Takes the result of a test and passes it to the assertion handler.

    Declaration

    Swift

    @discardableResult
    public func verify(_ pass: Bool, _ message: FailureMessage) -> AsyncExpectation<Value>

    Return Value

    An updated Expression with the result of the test applied to the status property.

  • Undocumented

    Declaration

    Swift

    public static func == (lhs: AsyncExpectation, rhs: ExpectationNil)
  • Undocumented

    Declaration

    Swift

    public static func != (lhs: AsyncExpectation, rhs: ExpectationNil)