This script class has five methods:
- TestReturnsOneWhenCreated(): This tests that the initial value of health is 1 when a new Health object is created.
- TestPointTwoAfterAddPointOneTwiceAfterKill(): This tests that after a kill (health set to zero), and then adding 0.1 on two occasions, that the health is 0.2.
- TestReturnsZeroWhenKilled(): This tests that the health value is set to zero immediately after the KillCharacter() method has been called.
- TestNoChangeAndReturnsFalseWhenAddNegativeValue(): This tests that attempting to add a negative value to health should return false and that the value of health should not have changed. This method is an example of a test with more than one assertion (but both are related to the actions).
- TestHealthNotGoAboveOne(): This test verifies that even when lots of values are added to health that total more than 1.0, the value that's returned from GetHealth() is 1.
Hopefully, all the tests pass when you run them, giving you...