Skip to content

Instantly share code, notes, and snippets.

@chriswebb09
Created June 4, 2017 01:44
Show Gist options
  • Save chriswebb09/6704723c29e71f5f0d24844cc0072279 to your computer and use it in GitHub Desktop.
Save chriswebb09/6704723c29e71f5f0d24844cc0072279 to your computer and use it in GitHub Desktop.
import XCTest
@testable import TestExample
class TestExampleTests: XCTestCase {
var math: Math!
override func setUp() {
super.setUp()
self.math = Math()
}
override func tearDown() {
super.tearDown()
math = nil
}
func testMathAddition() {
XCTAssertEqual(math.addition(intOne: 1, intTwo: 1), 2)
var addZeroTry = math.addition(intOne: 0, intTwo: 1)
XCTAssertFalse(addZeroTry == 2)
}
func testMathSubtraction() {
XCTAssertEqual(math.subtraction(intOne: 1, intTwo: 1), 0)
XCTAssertFalse(math.subtraction(intOne: 1, intTwo: 0) == 0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment