![]() |
The NEW Pong Game V13.2.1
An interesting implemnettaion of the pong game
|
Test suite for the User class functionality. More...
Functions | |
| int | main () |
| Main test runner function. | |
| void | test_constructor () |
| Tests the User class constructors. | |
| void | test_name_operations () |
| Tests user name operations. | |
| void | test_round_operations () |
| Tests round tracking functionality. | |
| void | test_score_operations () |
| Tests score manipulation operations. | |
Test suite for the User class functionality.
Ttests for verifying the proper functionality of our User class. We are testing the constructor, score management, name operations, and round incrementation.
| int main | ( | ) |
| void test_constructor | ( | ) |
Tests the User class constructors.
Makes sure both the default and parameterized constructors initialize the values correctly. The default constructor should set "Player" as the name, while the named constructor should use the provided name. Both should initialize score and rounds to 0.
| void test_name_operations | ( | ) |
Tests user name operations.
Checks if we can properly get and change player names. Names are important for the multiplayer experience and for displaying high scores in our game.
| void test_round_operations | ( | ) |
Tests round tracking functionality.
Validates that the round counter can be properly set and retrieved. This is essential for tracking game progress and managing multi-round matches.
| void test_score_operations | ( | ) |
Tests score manipulation operations.
Verifies that we can properly increment scores, directly set score values, and reset scores back to zero. This covers the core gameplay functionality needed for tracking player points.