def test_get_number_of_attacking_pairs_v(self): size = 5 queens = (XYLocation(1, 3), XYLocation(1, 4), XYLocation(1, 0)) nqb = NQueensBoard(size) nqb.set_board(queens) self.assertEqual(3, nqb.get_number_of_attacking_pairs())
def test_get_number_of_queens_on_board(self): size = 5 queens = (XYLocation(1, 1), XYLocation(2, 4), XYLocation(3, 3)) nqb = NQueensBoard(size) nqb.set_board(queens) self.assertEqual(3, nqb.get_number_of_queens_on_board())
def test_remove_queen_action(self): queens = (XYLocation(1, 3), XYLocation(1, 4), XYLocation(1, 0)) nqb = NQueensBoard(5) nqb.set_board(queens) nqrf = NQResultFunction() new_board = nqrf.result(nqb, QueenAction(QueenAction.REMOVE_QUEEN, XYLocation(1, 4))) self.assertEquals(2, new_board.get_number_of_queens_on_board())
def test_remove_queen_action(self): queens = (XYLocation(1, 3), XYLocation(1, 4), XYLocation(1, 0)) nqb = NQueensBoard(5) nqb.set_board(queens) nqrf = NQResultFunction() new_board = nqrf.result( nqb, QueenAction(QueenAction.REMOVE_QUEEN, XYLocation(1, 4))) self.assertEquals(2, new_board.get_number_of_queens_on_board())