Skip to content

Instantly share code, notes, and snippets.

@stevencurtis
Created July 7, 2020 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencurtis/bd44c06b9b6b47a6b95af5997e279f8e to your computer and use it in GitHub Desktop.
Save stevencurtis/bd44c06b9b6b47a6b95af5997e279f8e to your computer and use it in GitHub Desktop.
testadditem
func testAddItem() {
let CDM = CoreDataManagerMock()
let viewController = ViewControllerFactory().create(CDM)
guard let vc = viewController else {
return XCTFail("Could not instantiate ViewController")
}
vc.loadViewIfNeeded()
vc.tableView?.reloadData()
vc.textValue(textFieldValue: "add ME!")
let actualCell = viewController?.tableView!.cellForRow(at: IndexPath(row: 1, section: 0) )
XCTAssertEqual("add ME!", actualCell?.textLabel?.text)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment