XCTest should have a version of XCTAssertNotNil() for Swift that works like an if let, or some sort of compact syntax or variable promotion that tells Swift that after XCTAssertNotNil(foo), foo can’t be NIL anymore.