---
title: "expectIdentifier(_:)"
framework: appintentstesting
role: symbol
role_heading: Instance Method
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/appentitydefinition/expectidentifier(_:)"
---

# expectIdentifier(_:)

Creates an expectation that an app entity is the instance with the specified identifier.

## Declaration

```swift
func expectIdentifier(_ identifier: String) -> AppEntityIdentifierExpectation
```

## Parameters

- `identifier`: The identifier of the entity instance to expect.

## Return Value

Return Value An expectation that compares an entity’s identifier to identifier.

## Discussion

Discussion Use the returned expectation for an intent parameter, an intent result, or a property that holds an entity. Call expect on it to also check the instance’s properties. For example: let workCalendarExpectation = createEventIntentDefinition.expect(     calendar: calendarEntityDefinition.expectIdentifier(         "edea53fb-90b7-4481-afc7-d86e2dd0d27d"     ) )
