Created
January 26, 2017 02:32
-
-
Save chelseatroy/3d3804d58db4151889e57347df5762f7 to your computer and use it in GitHub Desktop.
Passing Information With Segues Example iOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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