Skip to content

Instantly share code, notes, and snippets.

@michaeleisel
Created January 8, 2015 19:00
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 michaeleisel/6ef360c047c0d74399e1 to your computer and use it in GitHub Desktop.
Save michaeleisel/6ef360c047c0d74399e1 to your computer and use it in GitHub Desktop.
//
// MainControllerTests.swift
// Inhale
//
// Created by Michael Eisel on 1/7/15.
// Copyright (c) 2015 Fredrik Krafft. All rights reserved.
//
import XCTest
class MainControllerTests: XCTestCase {
var controller: MainController
override func setUp() {
super.setUp()
controller = UIStoryboard.instantiateViewControllerWithClass(MainController) as MainController
controller.graphStartDate = NSDate()
controller.graphEndDate = controller.graphStartDate + 2.hour
}
func testXValueForDate() {
threeQuartersDate = controller.graphEndDate - (controller.graphEndDate - controller.graphStartDate) * 0.25
XCTAssertEqual(controller.xValueForDate(threeQuartersDate), 0.75 * controller.graphView.width)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment