AsyncExpectation

public struct AsyncExpectation<Value> : Expectation

Undocumented

  • Undocumented

    Declaration

    Swift

    public let expression: AsyncExpression<Value>
  • The status of the test after matchers 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: AsyncExpression<Value>)
  • Undocumented

    Declaration

    Swift

    public var location: SourceLocation { get }
  • 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.

  • to(_:description:) Asynchronous

    Tests the actual value using a matcher to match.

    Declaration

    Swift

    @discardableResult
    public func to(_ matcher: Matcher<Value>, description: String? = nil) async -> AsyncExpectation<Value>
  • toNot(_:description:) Asynchronous

    Tests the actual value using a matcher to not match.

    Declaration

    Swift

    @discardableResult
    public func toNot(_ matcher: Matcher<Value>, description: String? = nil) async -> AsyncExpectation<Value>
  • notTo(_:description:) Asynchronous

    Tests the actual value using a matcher to not match.

    Alias to toNot().

    Declaration

    Swift

    @discardableResult
    public func notTo(_ matcher: Matcher<Value>, description: String? = nil) async -> AsyncExpectation<Value>
  • to(_:description:) Asynchronous

    Tests the actual value using a matcher to match.

    Declaration

    Swift

    @discardableResult
    public func to(_ matcher: AsyncMatcher<Value>, description: String? = nil) async -> AsyncExpectation<Value>
  • toNot(_:description:) Asynchronous

    Tests the actual value using a matcher to not match.

    Declaration

    Swift

    @discardableResult
    public func toNot(_ matcher: AsyncMatcher<Value>, description: String? = nil) async -> AsyncExpectation<Value>
  • notTo(_:description:) Asynchronous

    Tests the actual value using a matcher to not match.

    Alias to toNot().

    Declaration

    Swift

    @discardableResult
    public func notTo(_ matcher: AsyncMatcher<Value>, description: String? = nil) async -> AsyncExpectation<Value>
  • ==(_:_:) Asynchronous

    Undocumented

    Declaration

    Swift

    public static func == (lhs: AsyncExpectation, rhs: ExpectationNil) async
  • !=(_:_:) Asynchronous

    Undocumented

    Declaration

    Swift

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

With Synchronous Matchers

With AsyncMatchers