<!--
{
  "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/AppEntityExpectation",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting0A17EntityExpectationV"
  },
  "title" : "AppEntityExpectation"
}
-->

# AppEntityExpectation

An expectation that checks an app entity’s type, its property values, and,
optionally, its instance identifier.

```
struct AppEntityExpectation
```

## Overview

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`](/documentation/AppIntentsTesting/AppEntityDefinition) to check an entity’s properties, or on an
[`AppEntityIdentifierExpectation`](/documentation/AppIntentsTesting/AppEntityIdentifierExpectation) to also check its identifier:

```swift
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:)`](/documentation/AppIntentsTesting/IntentValueExpectation/isSatisfied(by:)).

## Relationships

### Conforms To

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

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

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

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

---

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)