<!--
{
  "availability" : [
    "iOS: 27.3.0 -",
    "iPadOS: 27.3.0 -",
    "macCatalyst: 27.3.0 -",
    "macOS: 27.3.0 -",
    "tvOS: 27.3.0 -",
    "visionOS: 27.3.0 -",
    "watchOS: 27.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/AppIntentExpectation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting0A17IntentExpectationV"
  },
  "title" : "AppIntentExpectation"
}
-->

# AppIntentExpectation

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

```
struct AppIntentExpectation
```

## 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`](/documentation/AppIntentsTesting/AppIntentDefinition/expect) or [`result(_:)`](/documentation/AppIntentsTesting/AppIntentDefinition/result(_:)) on an
intent definition, and optionally call [`result(_:)`](/documentation/AppIntentsTesting/AppIntentExpectation/result(_:)) to add an expectation
on the result. To check an intent and its result, call
[`isSatisfied(by:result:)`](/documentation/AppIntentsTesting/AppIntentExpectationProviding/isSatisfied(by:result:)):

```swift
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

[`func result((any IntentValueExpectation)?) -> AppIntentExpectation`](/documentation/AppIntentsTesting/AppIntentExpectation/result(_:))

Returns an intent expectation that also requires the intent’s result to
satisfy the value expectation you specify.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`AppIntentExpectationProviding`](/documentation/AppIntentsTesting/AppIntentExpectationProviding)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)