---
title: PrimitiveExpectation
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/primitiveexpectation
---

# PrimitiveExpectation

A value expectation that checks whether a value is present or whether its string content matches.

## Declaration

```swift
struct PrimitiveExpectation
```

## Overview

Overview Use a primitive expectation to require that an intent parameter, app entity property, or intent result has a value or has no value, or to check the content of a string value. String comparisons are exact and case-sensitive. A string expectation on a non-string value isn’t satisfied. You don’t create a primitive expectation directly. Use isNil, notNil, contains(_:), contains(regex:), or equals(_:) instead. Passing nil as an expect argument is the same as leaving out its label: the expectation doesn’t check the value. The following example expects an event with a title that contains “NASA”, a location, and no end date: let createEventIntentDefinition = definitions.intents["CreateEventIntent"] let expectation = createEventIntentDefinition.expect(     title: .contains("NASA"),     location: .notNil,     endDate: .isNil )

## Relationships

### Conforms To

- [IntentValueExpectation](appintentstesting/intentvalueexpectation.md)
- [ResolvableIntentValueExpectation](appintentstesting/resolvableintentvalueexpectation.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
