|
|
@ -25,9 +25,9 @@ final class EmptyBoardTests: XCTestCase {
|
|
|
|
|
|
|
|
|
|
|
|
func testEmptyByDefault() throws {
|
|
|
|
func testEmptyByDefault() throws {
|
|
|
|
XCTAssertNil(board[1, 1])
|
|
|
|
XCTAssertNil(board[1, 1])
|
|
|
|
XCTAssertEqual(board.countPieces(), 0)
|
|
|
|
let result = board.countPieces()
|
|
|
|
XCTAssertEqual(board.countPieces(of_type: .Player1), 0)
|
|
|
|
XCTAssertEqual(result.a, 0)
|
|
|
|
XCTAssertEqual(board.countPieces(of_type: .Player2), 0)
|
|
|
|
XCTAssertEqual(result.b, 0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func testSetGet() throws {
|
|
|
|
func testSetGet() throws {
|
|
|
@ -39,9 +39,9 @@ final class EmptyBoardTests: XCTestCase {
|
|
|
|
func testCounts() throws {
|
|
|
|
func testCounts() throws {
|
|
|
|
board[1, 2] = .Player2
|
|
|
|
board[1, 2] = .Player2
|
|
|
|
|
|
|
|
|
|
|
|
XCTAssertEqual(board.countPieces(), 1)
|
|
|
|
let counts = board.countPieces()
|
|
|
|
XCTAssertEqual(board.countPieces(of_type: .Player1), 0)
|
|
|
|
XCTAssertEqual(counts.a, 0)
|
|
|
|
XCTAssertEqual(board.countPieces(of_type: .Player2), 1)
|
|
|
|
XCTAssertEqual(counts.b, 1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func testInsertTopNoPush() {
|
|
|
|
func testInsertTopNoPush() {
|
|
|
|