You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
814 B
31 lines
814 B
//
|
|
// BoardTest.swift
|
|
//
|
|
//
|
|
// Created by BREUIL Yohann on 19/01/2023.
|
|
//
|
|
|
|
import XCTest
|
|
import Model
|
|
|
|
final class BoardTest: XCTestCase {
|
|
func testInit() throws {
|
|
func expect(nbRows : Int, nbColumns : Int, notNil : Bool) {
|
|
let board = Board(withNbRows: nbRows, withNbColumns: nbColumns)
|
|
|
|
if !notNil {
|
|
XCTAssertNil(board)
|
|
return
|
|
}
|
|
XCTAssertNotNil(board)
|
|
XCTAssertEqual(board?.nbRows, nbRows)
|
|
XCTAssertEqual(board?.nbColumns, nbColumns)
|
|
}
|
|
|
|
expect(nbRows: 6, nbColumns: 7, notNil: true)
|
|
expect(nbRows: 0, nbColumns: 7, notNil: false)
|
|
expect(nbRows: 6, nbColumns: 0, notNil: false)
|
|
expect(nbRows: 0, nbColumns: 0, notNil: false)
|
|
}
|
|
}
|