featured in Exercise 2 of the new "Introduction to OOP" course,
HUJI, Winter 2021-2022 Semester.
Written by Erel Debel.
↓↓ Instructions at the bottom ↓↓
Important info about CleverPlayerTest and SnartypamtsPlayerTest:
Pay attention to the documentation. without any change these classes solely test using the current Board.SIZE and Board.WIN_STREAK values. As documented in these classes it is recommended you temporarily remove the final modifiers from these constant and uncomment the test methods in these classes for a full test of the wanted Win/Lose ratio.
The test support the printing in Tournament.playTournament as defined in the forum: "=== player 1: %d | player 2: %d | Draws: %d ===\r"
========================================================================================
The tests can be configured and run by:
-
Put the test directory, testSrc, in your project directory (in the same directory as "src" and "out"):
-
Open the project in IntelliJ if you haven't yet.
-
Right-click the testSrc directory and choose
Mark Directory as -> Test Sources Root: -
Open the file BoardTest.java inside the testSrc directory.
-
On the first line' hover mouse over the red text and press Alt+Enter:
-
Then choose JUnit 5:
-
Right-click testSrc directory or press Ctrl+Shift+F10 to run all tests:
Good luck!
Erel