---
title: isInverted
framework: xctest
role: symbol
role_heading: Instance Property
path: xctest/xctestexpectation/isinverted
---

# isInverted

Indicates that the expectation is not intended to happen.

## Declaration

```swift
var isInverted: Bool { get set }
```

## Discussion

Discussion To check that a situation does not occur during testing, create an expectation that is fulfilled when the unexpected situation occurs, and set its isInverted property to true. Your test will fail immediately if the inverted expectation is fulfilled.
