<!--
{
  "documentType" : "article",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/boolean-assertions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Boolean Assertions"
}
-->

# Boolean Assertions

Test a condition that generates a true or false result.

## Topics

### Tests for True Conditions

[`XCTAssert(_:_:file:line:)`](/documentation/XCTest/XCTAssert(_:_:file:line:))

Asserts that an expression is true.

[`XCTAssertTrue(_:_:file:line:)`](/documentation/XCTest/XCTAssertTrue(_:_:file:line:))

Asserts that an expression is true.

[`XCTAssert`](/documentation/XCTest/XCTAssert)

Asserts that an expression is true.

[`XCTAssertTrue`](/documentation/XCTest/XCTAssertTrue)

Asserts that an expression is true.

### Tests for False Conditions

[`XCTAssertFalse(_:_:file:line:)`](/documentation/XCTest/XCTAssertFalse(_:_:file:line:))

Asserts that an expression is false.

[`XCTAssertFalse`](/documentation/XCTest/XCTAssertFalse)

Asserts that an expression is false.



---

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)