result(_:)
Returns an intent expectation that also requires the intent’s result to satisfy the value expectation you specify.
Declaration
func result(_ resultExpectation: (any IntentValueExpectation)?) -> AppIntentExpectationParameters
- resultExpectation:
The value expectation for the intent’s result. Pass Isnil to expect no result, or
nilto leave the result unchecked.
Return Value
An intent expectation that checks the same parameters and uses resultExpectation for the result, replacing any earlier result expectation.
Discussion
Call this method after expect to check an intent’s parameters and its result together:
let expectation = createEventIntentDefinition
.expect(title: .contains("NASA"))
.result(eventEntityDefinition)