---
title: AppIntentExpectation
framework: appintentstesting
role: symbol
role_heading: Structure
platforms: [iOS 27.3+, iPadOS 27.3+, Mac Catalyst 27.3+, macOS 27.3+, tvOS 27.3+, visionOS 27.3+, watchOS 27.3+]
path: appintentstesting/appintentexpectation
---

# AppIntentExpectation

An expectation that checks an app intent’s parameters and, optionally, the result the intent returns.

## Declaration

```swift
struct AppIntentExpectation
```

## Overview

Overview Use an app intent expectation to declare what you expect of an intent before you have one, then check an intent against it or pass it to a framework that takes intent expectations. The expectation checks only the parameters you specify, and checks the result only when you add a result expectation. Checking an expectation doesn’t perform the intent. You don’t create an app intent expectation directly. Call expect or result(_:) on an intent definition, and optionally call result(_:) to add an expectation on the result. To check an intent and its result, call isSatisfied(by:result:): let expectation = createEventIntentDefinition     .expect(title: .contains("NASA"))     .result(eventEntityDefinition)

let result = try await intent.run() let isSatisfied = try await expectation.isSatisfied(     by: intent,     result: result )

## Topics

### Instance Methods

- [result(_:)](appintentstesting/appintentexpectation/result(_:).md)

## Relationships

### Conforms To

- [AppIntentExpectationProviding](appintentstesting/appintentexpectationproviding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
