Skip to content

Instantly share code, notes, and snippets.

@up1
Last active August 29, 2015 14:24
Show Gist options
  • Save up1/2607f967a63e9a2d1afa to your computer and use it in GitHub Desktop.
Save up1/2607f967a63e9a2d1afa to your computer and use it in GitHub Desktop.
Xcode 7 beta 3 + Swift
import XCTest
@testable import DemoTesting01
class DemoTesting01Tests: XCTestCase {
}
import XCTest
@testable import DemoTesting01
class DemoTesting01Tests: XCTestCase {
let fizzBuzz = FizzBuzz()
func testOne() {
XCTAssertEqual("1", fizzBuzz.say(1))
}
func testFizz() {
XCTAssertEqual("Fizz", fizzBuzz.say(3))
}
}
class FizzBuzz {
func say(number: Int) -> String {
if(number%3 == 0) {
return "Fizz"
}
if(number == 2) {
return "2"
}
return "1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment