XCTAssert Family and Throwing Assertions
Using XCTAssertEqual, XCTAssertThrowsError and XCTUnwrap safely.
XCTAssert and XCTAssertTrue
XCTAssert and XCTAssertTrue fail if the condition is false.
XCTAssert(user.isLoggedIn)
XCTAssertTrue(cart.isEmpty, "Cart should be empty after clear()")XCTAssertFalse
XCTAssertFalse fails if the condition is true.
XCTAssertFalse(session.isExpired, "Fresh session should not be expired")All lessons in this course
- XCTestCase Setup, Teardown and Test Methods
- XCTAssert Family and Throwing Assertions
- Protocol-Based Mocking and Dependency Injection
- Async Tests and Performance Measurement