<commit_before>//
//  GameBoardTests.swift
//  TicTacToeTests
//
//  Created by <NAME> on 11/27/15.
//  Copyright © 2015 iJoshSmith. All rights reserved.
//

import XCTest
@testable import TicTacToe

class GameBoardTests: XCTestCase {

    // MARK: - emptyPositions
    
    func test_emptyPositions_twoPositionsAreEmpty_returnsOnlyThoseTwoPositions() {
        let board = GameBoard(dimension: 3)
        board.marks = [
            [.X, .O,     .Empty],
            [.O, .X,     .X    ],
            [.O, .Empty, .O    ]]
        let emptyPositions = board.emptyPositions
        XCTAssertEqual(emptyPositions.count, 2)
        XCTAssertEqual(emptyPositions[0].row,    0)
        XCTAssertEqual(emptyPositions[0].column, 2)
        XCTAssertEqual(emptyPositions[1].row,    2)
        XCTAssertEqual(emptyPositions[1].column, 1)
    }
    
    // MARK: - marksInRow
    
    func test_marksInRow_rowIsEmpty_returnsEmptyRow() {
        let board = GameBoard(dimension: 3)
        XCTAssertEqual(board.marksInRow(0), [.Empty, .Empty, .Empty])
    }
    
    // MARK: - marksInColumn
    
    func test_marksInColumn_columnIsEmpty_returnsEmptyColumn() {
        let board = GameBoard(dimension: 3)
        XCTAssertEqual(board.marksInColumn(0), [.Empty, .Empty, .Empty])
    }
    
    // MARK: - marksInDiagnoal<commit_msg>increase GameBoard test coverage<commit_after>//
//  GameBoardTests.swift
//  TicTacToeTests
//
//  Created by <NAME> on 11/27/15.
//  Copyright © 2015 iJoshSmith. All rights reserved.
//

import XCTest
@testable import TicTacToe

class GameBoardTests: XCTestCase {

    // MARK: - emptyPositions
    
    func test_emptyPositions_twoPositionsAreEmpty_returnsOnlyThoseTwoPositions() {
        let board = GameBoard(dimension: 3)
        board.marks = [
            [.X, .O,     .Empty],
            [.O, .X,     .X    ],
            [.O, .Empty, .O    ]]
        let emptyPositions = board.emptyPositions
        XCTAssertEqual(emptyPositions.count, 2)
        XCTAssertEqual(emptyPositions[0].row,    0)
        XCTAssertEqual(emptyPositions[0].column, 2)
        XCTAssertEqual(emptyPositions[1].row,    2)
        XCTAssertEqual(emptyPositions[1].column, 1)
    }
    
    // MARK: - marksInRow
    
    func test_marksInRow_rowIsEmpty_returnsEmptyRow() {
        let board = GameBoard(dimension: 3)
        XCTAssertEqual(board.marksInRow(0), [.Empty, .Empty, .Empty])
    }
    
    func test_marksInRow_rowIsXOX_returnsXOX() {
        let board = GameBoard(dimension: 3)
        board.marks = [
            [.Empty, .Empty, .Empty],
            [.X,     .O,     .X    ],
            [.Empty, .Empty, .Empty]]
        XCTAssertEqual(board.marksInRow(1), [.X, .O, .X])
    }
    
    // MARK: - marksInColumn
    
    func test_marksInColumn_columnIsEmpty_returnsEmptyColumn() {
        let board = GameBoard(dimension: 3)
        XCTAssertEqual(board.marksInColumn(0), [.Empty, .Empty, .Empty])
    }
    
    func test_marksInColumn_columnIsXOX_returnsXOX() {
        let board = GameBoard(dimension: 3)
        board.marks = [
            [.Empty, .X, .Empty],
            [.Empty, .O, .Empty],
            [.Empty, .X, .Empty]]
        XCTAssertEqual(board.marksInColumn(1), [.X, .O, .X])
    }
    
    // MARK: - marksInDiagnoal
{'fraction_non_alphanumeric': 0.12269938650306748, 'fraction_numerical': 0.015950920245398775, 'mean_word_length': 2.1783625730994154, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4607246', 'n_tokens_mistral': 1156, 'n_tokens_neox': 1090, 'n_words': 202}