Instead of relying on a specific instance of the Player, write your unit tests on the interface (or equivalent) and rely on mocks or other interaction to confirm not that the player is in the correct state, but simply that the right calls (in terms of GameMaster class.
If you cannot verify the correct behavior of the GameMaster class without relying on end-state confirmation, this is a sign that your responsibilities are inappropriate. GameMaster should be responsible for informing the Player what happened, while the Player should be responsible for taking the appropriate action.
This is also useful because it means that tests for GameMaster will depend only on the behavior of the GameMaster class, and it will not need to be touched if the Player class changes its behavior.
Avoid adding getters for unit tests. When you are tempted to add a getter, look instead at using interaction testing (as I just described) instead of state testing.
source share