Skip to content

Instantly share code, notes, and snippets.

@rtking1993
Created March 28, 2018 18:19
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 rtking1993/7e1b7bad3cbd98a37c77ada2f311a0a0 to your computer and use it in GitHub Desktop.
Save rtking1993/7e1b7bad3cbd98a37c77ada2f311a0a0 to your computer and use it in GitHub Desktop.
Just one function of my test class to test the logic of my calculator operations
// MARK: Frameworks
import XCTest
// MARK: CalculatorInteractorTests
class CalculatorInteractorTests: XCTestCase {
// MARK: Variables
var calculatorInteractor: CalculatorInteractor!
// MARK: Setup Methods
override func setUp() {
super.setUp()
calculatorInteractor = CalculatorInteractor()
}
// MARK: Addition Tests
func testAddition() {
let numberOne: Float = 4
let numberTwo: Float = 9
let result = calculatorInteractor.add(numberOne: numberOne, to: numberTwo)
XCTAssertEqual(result, 13)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment