Let's suppose you want to create unit tests for a game.
You have the Player class, which has a local variable of the World class (instantiated by the construtor) and the World object has an open connection to the database.
So player.breakBlock() method would call world.breakBlockAt(x,y,z) and world.breakBlockAt(int x, int y, int z) method would perform changes to the database and return the result.
In cases like this where you have complex "object dependencies", what would be the best way to perform testing?
Currently I'm basically starting the whole game environment, with a test database, spawning a fake Player and using it for the testing.