Class

XCTestExpectation

An expected outcome in an asynchronous test.

Declaration

@interface XCTestExpectation : NSObject

Topics

Creating Expectations

- initWithDescription:

Creates a new XCTestExpectation with the provided description.

expectationDescription

A human readable string used to describe the expectation in log output and test reports.

Fulfilling Expectations

- fulfill

Marks the expectation as having been met.

Fulfillment Count

expectedFulfillmentCount

The number of times fulfill must be called before the expectation is completely fulfilled.

assertForOverFulfill

Indicates that an assertion should be triggered during testing if the expectation is over-fulfilled.

Unintended Expectations

inverted

Indicates that the expectation is not intended to happen.

Relationships

Inherits From

See Also

First Steps

Testing Asynchronous Operations with Expectations

Verify that asynchronous operations behave as expected.