|
@ -3,6 +3,7 @@ |
|
|
|
|
|
|
|
|
#include "encounter.h" |
|
|
#include "encounter.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void setUp(void){ |
|
|
void setUp(void){ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -43,4 +44,16 @@ void test_playerIsNotOverhealed(void){ |
|
|
TEST_ASSERT_EQUAL(expectedHealth, health); |
|
|
TEST_ASSERT_EQUAL(expectedHealth, health); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_setEnemyHealth(void){ |
|
|
|
|
|
//arrange |
|
|
|
|
|
int health = 50, result; |
|
|
|
|
|
//act |
|
|
|
|
|
enemy test = {health*2}; |
|
|
|
|
|
setEnemyHealth(&test.health, health); |
|
|
|
|
|
//assert |
|
|
|
|
|
TEST_ASSERT_EQUAL(health, test.health); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |