Contents

AppIntentExpectationProviding

A type that describes the app intent you expect, including its type and, optionally, its parameter values and result.

Declaration

protocol AppIntentExpectationProviding : Sendable

Overview

An intent definition on its own expects any intent of its type, whatever its parameters are. Call expect to also check parameter values, and result(_:) or result(_:) to check the result. Check an intent with isSatisfied(by:result:), or pass the expectation to a framework that takes intent expectations.

You get intent expectations from intent definitions. Don’t declare new conformances to this protocol.

For example, expect an intent with a title that contains a substring:

let expectation = createEventIntentDefinition.expect(
    title: .contains("NASA")
)
let isSatisfied = try await expectation.isSatisfied(by: intent)

Topics

Instance Methods