Complete the code to import the XCTest framework.
import [1]
The XCTest framework is imported using import XCTest to write test cases.
Complete the code to define a test case class named MyTests.
class MyTests: [1] { }
Test case classes must inherit from XCTestCase to use XCTest features.
Fix the error in the test method declaration to make it a valid XCTest test method.
func [1]() { XCTAssertTrue(true) }Test methods must start with the word test and be lowercase to be recognized by XCTest.
Fill both blanks to create a test method that checks if 2 + 2 equals 4.
func [1]() { XCTAssertEqual([2], 4) }
The test method name should start with 'test'. The expression 2 + 2 is checked to equal 4.
Fill all three blanks to write a test method that fails if a string is empty.
func [1]() { let text = "Hello" XCTAssertFalse([2].[3]) }
The test method name starts with 'test'. The variable text is checked using its isEmpty property inside XCTAssertFalse.