Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Passing Information With Segues Example iOS
import XCTest
import Hamcrest
import FutureKit
@testable import FruitApp
class ListOfFruitsViewControllerTest: XCTestCase {
func testShowsFruitDetailsWhenFruitRowIsTapped() {
let orange = FruitAppFruit(name: "Orange")
fruitService.stubbedFruits = [orange]
fruitListController.tableView(fruitListController.fruitTableView, didSelectRowAtIndexPath: NSIndexPath(forRow: 0, inSection: 0))
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.001, false)
assertThat(navigationController.topViewController, presentAnd(instanceOf(FruitDetailViewController.self)))
let fruitDetailsController = navigationController.topViewController as! FruitDetailViewController
assertThat(fruitDetailsController.fruit, presentAnd(equalTo(orange)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.