Last active
August 29, 2015 14:24
-
-
Save up1/2607f967a63e9a2d1afa to your computer and use it in GitHub Desktop.
Xcode 7 beta 3 + Swift
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 | |
@testable import DemoTesting01 | |
class DemoTesting01Tests: 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
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)) | |
} | |
} |
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 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