Class ChessQueensAllTest
java.lang.Object
topics.backtracking.nqueens.ChessQueensAllTest
Test Suite for ChessQueensAll
Validates the exhaustive backtracking algorithm for the N-Queens problem. Employs assertions to verify the exact number of valid combinatorial arrangements across various board dimensions.
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidsetup()Initializes context and resources prior to executing the test suite.(package private) voidScenario: A 3x3 chessboard.(package private) voidScenario: A 5x5 chessboard.(package private) voidScenario: A 4x4 chessboard.(package private) static voidteardown()Cleans up resources after the entire test suite has finished execution.
-
Constructor Details
-
ChessQueensAllTest
ChessQueensAllTest()
-
-
Method Details
-
setup
@BeforeAll static void setup()Initializes context and resources prior to executing the test suite. -
teardown
@AfterAll static void teardown()Cleans up resources after the entire test suite has finished execution. -
shouldFindTwoSolutionsOn4x4Board
@Test void shouldFindTwoSolutionsOn4x4Board()Scenario: A 4x4 chessboard.
Expected Outcome: Mathematical proofs dictate exactly 2 valid non-threatening arrangements for 4 queens.
-
shouldFindTenSolutionsOn5x5Board
@Test void shouldFindTenSolutionsOn5x5Board()Scenario: A 5x5 chessboard.
Expected Outcome: The algorithm must traverse the state space and discover exactly 10 valid arrangements.
-
shouldFindNoSolutionsOn3x3Board
@Test void shouldFindNoSolutionsOn3x3Board()Scenario: A 3x3 chessboard.
Expected Outcome: It is geometrically impossible to place 3 non-threatening queens on a 3x3 board. The result must be 0.
-