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

# IntentValueExpectation

A type that describes the value you expect for an intent parameter, an app
entity property, or an intent result.

```
protocol IntentValueExpectation : Sendable
```

## Overview

A value expectation states a requirement on a single value, such as a string
that contains a substring, or a value that’s absent. Pass value expectations
to [`expect`](/documentation/AppIntentsTesting/AppEntityDefinition/expect) and [`result(_:)`](/documentation/AppIntentsTesting/AppIntentDefinition/result(_:)) to
build entity and intent expectations, or check a value directly with
[`isSatisfied(by:)`](/documentation/AppIntentsTesting/IntentValueExpectation/isSatisfied(by:)). Intent parameters accept only
[`ResolvableIntentValueExpectation`](/documentation/AppIntentsTesting/ResolvableIntentValueExpectation) values; see
[`expect`](/documentation/AppIntentsTesting/AppIntentDefinition/expect).

You get value expectations from the static members that the framework
provides, such as [`contains(_:)`](/documentation/AppIntentsTesting/IntentValueExpectation/contains(_:)), [`isNil`](/documentation/AppIntentsTesting/IntentValueExpectation/isNil), and
[`matches(_:requirement:)`](/documentation/AppIntentsTesting/IntentValueExpectation/matches(_:requirement:)), and from entity definitions and entity
expectations. Don’t declare new conformances to this protocol.

For example, check whether an entity from an intent result has a title that
contains a substring:

```swift
let event: AnyAppEntity = try result.value
let expectation = eventEntityDefinition.expect(title: .contains("NASA"))
let isSatisfied = try await expectation.isSatisfied(by: event)
```

## Topics

### Instance Methods

[`func isSatisfied(by: (any IntentValueExpressing)?) async throws -> Bool`](/documentation/AppIntentsTesting/IntentValueExpectation/isSatisfied(by:))

Returns a Boolean value that indicates whether a value meets the
requirements of the expectation.

### Type Properties

[`static var isNil: PrimitiveExpectation`](/documentation/AppIntentsTesting/IntentValueExpectation/isNil)

An expectation that requires a parameter, property, or result to have no
value.

[`static var notNil: PrimitiveExpectation`](/documentation/AppIntentsTesting/IntentValueExpectation/notNil)

An expectation that requires a parameter, property, or result to have a
value.

### Type Methods

[`static func contains(String) -> Self`](/documentation/AppIntentsTesting/IntentValueExpectation/contains(_:))

Creates an expectation that requires the value to be a string that
contains a substring.

[`static func contains(regex: String) -> Self`](/documentation/AppIntentsTesting/IntentValueExpectation/contains(regex:))

Creates an expectation that requires the value to be a string that
contains a match for a regular expression.

[`static func equals(String) -> Self`](/documentation/AppIntentsTesting/IntentValueExpectation/equals(_:))

Creates an expectation that requires the value to be a string that
equals a specified string.

[`static func matches<Input>(Predicate<Input>, requirement: String?) -> PredicateExpectation`](/documentation/AppIntentsTesting/IntentValueExpectation/matches(_:requirement:))

Creates an expectation that requires the value to satisfy a predicate,
with an optional description of the check.

## Relationships

### Conforming Types

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

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

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

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

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

### Inherited By

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

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

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

### Inherits From

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

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

---

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)