|
@ -49,7 +49,7 @@ void test_playerIsDamaged(void) |
|
|
int expectedHealth = 90; |
|
|
int expectedHealth = 90; |
|
|
// act |
|
|
// act |
|
|
Character testChar = {10,10,10,health,100,1,0,100,damage,armor,100}; |
|
|
Character testChar = {10,10,10,health,100,1,0,100,damage,armor,100}; |
|
|
health = playerHealth(health, damage, armor, &testChar); |
|
|
|
|
|
|
|
|
health = playerDamaged(health, damage, armor, &testChar); |
|
|
// assert |
|
|
// assert |
|
|
TEST_ASSERT_EQUAL(expectedHealth, health); |
|
|
TEST_ASSERT_EQUAL(expectedHealth, health); |
|
|
} |
|
|
} |
|
@ -63,7 +63,7 @@ void test_playerIsNotOverhealed(void) |
|
|
int expectedHealth = 100; |
|
|
int expectedHealth = 100; |
|
|
// act |
|
|
// act |
|
|
Character testChar = {10,10,10,health,100,1,0,100,10,armor,100}; |
|
|
Character testChar = {10,10,10,health,100,1,0,100,10,armor,100}; |
|
|
health = playerHealth(health, heal, armor, &testChar); |
|
|
|
|
|
|
|
|
health = playerHeal(health, heal, armor, &testChar); |
|
|
// assert |
|
|
// assert |
|
|
TEST_ASSERT_EQUAL(expectedHealth, health); |
|
|
TEST_ASSERT_EQUAL(expectedHealth, health); |
|
|
} |
|
|
} |
|
|