testIncrement() { counter += 1 XCTAssertEqual(counter, 2) } func testDecrement() { counter -= 1 XCTAssertEqual(counter, 1) } } class XCTestDemoIntegerTests: XCTestCase { var counter: Int = 1 func testIncrement() { counter += 1 XCTAssertEqual(counter, 2) } func testDecrement() { counter -= 1 } } Example XCTAssertEqual(counter, 0)