XCTest
XCTest is Apple’s framework for writing and running unit tests and performance tests in Xcode-based projects. It supports Swift and Objective-C code and is used for apps targeting iOS, macOS, tvOS, and watchOS. The framework provides a standardized way to validate code behavior and detect regressions during development and in CI workflows.
Tests in XCTest are organized into test cases, which are subclasses of XCTestCase. Test methods must begin
XCTest provides a range of assertion functions, such as XCTAssertTrue, XCTAssertFalse, XCTAssertEqual, XCTAssertNotNil, XCTAssertNil, and XCTAssertThrowsError,
Asynchronous testing is supported via expectations (XCTestExpectation). Tests create expectations, fulfill them when the asynchronous task
XCTest integrates with Xcode schemes, Swift Package Manager, and CI pipelines. Tests can be authored in Swift