This file contains 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 CoreLocation | |
@testable import MyProject | |
class ViewControllerTest: XCTestCase { | |
var systemUnderTest: ViewController! | |
override func setUp() { | |
This file contains 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
func testSUT_UsesAPIClientToRequestModelData_WhenViewLoads() { | |
// declare mock of APIClient | |
class MockAPIClient: APIClient { | |
var modelObjectRequested: Bool! | |
override func fetchDataForId(id: Int, completion: (success: Bool, object: AnyObject?, message: String?) -> ()) { | |
// use property to confirm the data request was made | |
modelObjectRequested = true |
This file contains 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
func testSUT_PassesDataToTargetViewController() { | |
// declare the storyboard, source view controller, and target view controller | |
let storyboard: UIStoryboard = UIStoryboard(name: "Main_iPhone", bundle: nil) | |
let callingViewController = storyboard.instantiateViewControllerWithIdentifier("PlaceListViewController") as! PlaceListViewController | |
let targetViewController = storyboard.instantiateViewControllerWithIdentifier("PlaceDetailsViewController") as! PlaceDetailsViewController | |
// fetch the segue from story board | |
let targetSegue: UIStoryboardSegue = UIStoryboardSegue(identifier: callingViewController.placeDetailsViewControllerSegue, source: callingViewController, destination: targetViewController) | |
This file contains 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
class ViewControllerTest: XCTestCase { | |
var systemUnderTest: ViewController! | |
override func setUp() { | |
super.setUp() | |
//get the storyboard the ViewController under test is inside | |
let storyboard: UIStoryboard = UIStoryboard(name: "Main_iPhone", bundle: nil) |
This file contains 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
// | |
// TEST CODE | |
import XCTest | |
@testable import to | |
class JSONReaderTest: XCTestCase { | |
This file contains 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
// example of unit test for model initialization | |
// TEST CODE | |
import XCTest | |
@testable import yourmodule | |
class PlaceTest: XCTestCase { |
This file contains 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
Getting Started with AWS CLI (Command Line Interface) | |
1. Get your access key ID and secret access key | |
2. Check python (required 2.6.5+) | |
$ python --version | |
3. Download CLI via curl | |
$ mkdir AWSCLI |
This file contains 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
Description: | |
Steps for Getting Started with the Mapbox Android SDK (v 3.2) | |
1. Create a new project in Android Studio (1.5.1) (e.g. Empty Activity or Blank Activity template) | |
2. Installation via Gradle: | |
Added the following to the root ... | |
repositories { |