AppEntityExpectation
An expectation that checks an app entity’s type, its property values, and, optionally, its instance identifier.
Declaration
struct AppEntityExpectationOverview
An entity expectation checks an entity’s properties, such as those of an entity that an intent returns. It checks each property independently, and doesn’t check properties that have no expectation.
You don’t create an entity expectation directly. Call expect on an AppEntityDefinition to check an entity’s properties, or on an AppEntityIdentifierExpectation to also check its identifier:
let expectation = createEventIntentDefinition.result(
eventEntityDefinition.expect(
title: .contains("NASA"),
endDate: .isNil
)
)Pass an entity expectation to an intent’s result expectation, or wherever a property holds an entity. Intent parameters don’t accept entity expectations, because parameters hold entities as the caller passed them, before any entity query runs, so their properties aren’t available. To check an entity on its own, call isSatisfied(by:).