Beispiel #1
0
func TestPlacesAMoveOnBoard(t *testing.T) {
	board := NewBoard(rules.THREE_BY_THREE)
	testBoard := make([]string, 9)
	testBoard[0] = "x"
	board.PlaceMove(0, "x")
	assert.Equal(t, testBoard, board.Slots)
}
Beispiel #2
0
func TestReturnsMovesRemainingOnBoard(t *testing.T) {
	board := board.NewBoard(THREE_BY_THREE)
	board.PlaceMove(4, FIRST_PLAYER)
	assert.Equal(t, []int{0, 1, 2, 3, 5, 6, 7, 8}, MovesAvailable(board))
}