---
title: "testCase(_:didRecord:)"
framework: xctest
role: symbol
role_heading: Instance Method
path: "xctest/xctestobservation/testcase(_:didrecord:)-8k955"
---

# testCase(_:didRecord:)

Notifies the observer when a test case records an expected failure.

## Declaration

```swift
optional func testCase(_ testCase: XCTestCase, didRecord expectedFailure: XCTExpectedFailure)
```

## Parameters

- `testCase`: The test case with the expected failure.
- `expectedFailure`: The expected failure to record.

## See Also

### Observation Methods

- [testBundleWillStart(_:)](xctest/xctestobservation/testbundlewillstart(_:).md)
- [testSuiteWillStart(_:)](xctest/xctestobservation/testsuitewillstart(_:).md)
- [testCaseWillStart(_:)](xctest/xctestobservation/testcasewillstart(_:).md)
- [testCase(_:didRecord:)](xctest/xctestobservation/testcase(_:didrecord:)-4cou6.md)
- [testCase(_:didFailWithDescription:inFile:atLine:)](xctest/xctestobservation/testcase(_:didfailwithdescription:infile:atline:).md)
- [testCaseDidFinish(_:)](xctest/xctestobservation/testcasedidfinish(_:).md)
- [testSuite(_:didRecord:)](xctest/xctestobservation/testsuite(_:didrecord:)-3rk9k.md)
- [testSuite(_:didRecord:)](xctest/xctestobservation/testsuite(_:didrecord:)-1xjkv.md)
- [testSuite(_:didFailWithDescription:inFile:atLine:)](xctest/xctestobservation/testsuite(_:didfailwithdescription:infile:atline:).md)
- [testSuiteDidFinish(_:)](xctest/xctestobservation/testsuitedidfinish(_:).md)
- [testBundleDidFinish(_:)](xctest/xctestobservation/testbundledidfinish(_:).md)
