Skip to content

Instantly share code, notes, and snippets.

@bharath2020
Created December 29, 2015 14:33
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 bharath2020/2694d10cad7dfb014b2a to your computer and use it in GitHub Desktop.
Save bharath2020/2694d10cad7dfb014b2a to your computer and use it in GitHub Desktop.
Prerparation, Execution, Verification
func testWinnerHorizontally(){
//PREPARATION
//Prepare a board and mark position so that playerCode '1' wins
let board = TTBoard(boardIDString: NSUUID().UUIDString)
board.markPosition(0, playerCode: 1)
board.markPosition(3, playerCode: 2)
board.markPosition(1, playerCode: 1)
board.markPosition(5, playerCode: 2)
board.markPosition(2, playerCode: 1)
//EXECUTION
let winner = board.winner()
//VERIFICATION
let expectedWinner = 1;
XCTAssertEqual(winner, expectedWinner, "Failed Horizontal Winner");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment