Closed EddieLukeAtmey closed 1 year ago
I've found a hack to solve this issue:
import Closures
let tfPhone = try XCTUnwrap(vc.value(forKey: "phoneTextField") as? UITextField)
let selTextChange = Selector("editingChangedWithSender:event:")
tfPhone.perform(selTextChange, with: tfPhone, with: UIEvent())
Is there any way to write Unit Test that can cover the code inside the closure block?
For example, here's a block of code I'd like to cover. How can I trigger the textField closure?