Class

XCTNSNotificationExpectation

An expectation that is fulfilled when an expected NSNotification is received.

Declaration

@interface XCTNSNotificationExpectation : XCTestExpectation

Topics

Creating NSNotification Expectations

- initWithName:

Creates an expectation that is fulfilled when an NSNotification is posted from the default notification center by any object.

- initWithName:object:

Creates an expectation that is fulfilled when an NSNotification is posted from the default notification center by a specific object.

- initWithName:object:notificationCenter:

Creates an expectation that is fulfilled when an NSNotification is posted from a specific notification center, optionally by a specific object.

Expectation Properties

notificationName

The name of the notification that the expectation is waiting for.

observedObject

The object by which the notification must be posted, or nil if the notification can be posted by any object.

notificationCenter

The notification center from which the notification must be posted.

Custom Notification Evaluation

handler

An optional handler that performs custom evaluation of matching notifications.

XCNotificationExpectationHandler

A custom handler to be called when a matching notification is received.

Relationships

Inherits From

See Also

Notification-Based Expectations

XCTDarwinNotificationExpectation

An expectation that is fulfilled when an expected Darwin notification is received.