This is what happens when I tried following this (tweaked to use your example)
1. Wrote the test, pretty simple
2. Ran it, it failed, felt like a genius (not really but I was freaking out a bit)
3. Wrote the following code for the method (and added all the instance variables as needed on the fly):
Code:
public void hitByBullet () {
//check if hit
//reduce HP by one
}
Here I start to lose my composure because I want this to be in 3 methods - one to check if he's hit, one to reduce the HP (takes the amount to reduce it), and one that calls the first and then calls the second with the appropriate amount of HP to lose, which will ultimately be the one I call from the engine (it'll be a method inherited into all enemy types). But if I only think in terms of tests, it's not a good idea to do this, but rather the above. Also, because I'm only writing the code to make the test pass, I'm not even sure I need to check if the enemy is hit.
I think it might just be too early for me to try this or something.