def test_recalculateUnavailableSquares_A1C1noSquaresInResult_size13(self): queenSolver = QueenSolver() square = Square(ord('A'),1) queenSolver.addSquareToResults(square) square = Square(ord('C'),1) queenSolver.addSquareToResults(square) queenSolver.recalculateUnavailableSquares() self.assertEqual(len(queenSolver.unavailableSquare), 13)
def test_recalculateUnavailableSquares_A1C1noSquaresInResult_size13(self): queenSolver = QueenSolver() square = Square(ord('A'), 1) queenSolver.addSquareToResults(square) square = Square(ord('C'), 1) queenSolver.addSquareToResults(square) queenSolver.recalculateUnavailableSquares() self.assertEqual(len(queenSolver.unavailableSquare), 13)
def test_addSquareToResults_resultsWasEmpty_resultsHasOneComponent(self): queenSolver = QueenSolver() squareToAdd = Square(ord('A'),1) queenSolver.addSquareToResults(squareToAdd) self.assertEqual(len(queenSolver.results),1) self.assertEqual(queenSolver.results[0], squareToAdd)
def test_removeLatestSquare_resultsHadOneEntry_resultsHasNoEntries(self): queenSolver = QueenSolver() queenSolver.addSquareToResults(Square(ord('A'), 1)) self.assertEqual(len(queenSolver.results), 1) queenSolver.removeLatestSquare() self.assertEqual(len(queenSolver.results), 0)
def test_addSquareToResults_resultsWasEmpty_resultsHasOneComponent(self): queenSolver = QueenSolver() squareToAdd = Square(ord('A'), 1) queenSolver.addSquareToResults(squareToAdd) self.assertEqual(len(queenSolver.results), 1) self.assertEqual(queenSolver.results[0], squareToAdd)