// // 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) } }