|
@ -2,10 +2,14 @@ |
|
|
#include "unity.h" |
|
|
#include "unity.h" |
|
|
#include "character.h" |
|
|
#include "character.h" |
|
|
Character testCharacter; |
|
|
Character testCharacter; |
|
|
|
|
|
Character testCharacter2; |
|
|
|
|
|
|
|
|
void setUp(void) |
|
|
void setUp(void) |
|
|
{ |
|
|
{ |
|
|
testCharacter.healthPoints = 0; |
|
|
|
|
|
|
|
|
testCharacter.healthPoints = 0; |
|
|
|
|
|
testCharacter2.healthPoints = 15; |
|
|
|
|
|
testCharacter.strength = 0; |
|
|
|
|
|
testCharacter2.strength = 5; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void tearDown(void) |
|
|
void tearDown(void) |
|
@ -19,4 +23,16 @@ void test_setCharacterHealthPoints(void) |
|
|
TEST_ASSERT_EQUAL_INT(50,testCharacter.healthPoints); |
|
|
TEST_ASSERT_EQUAL_INT(50,testCharacter.healthPoints); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_getCharacterHealthPoints (void) { |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(15,testCharacter2.healthPoints); |
|
|
|
|
|
} |
|
|
|
|
|
void test_setCharacterStrenght(void) |
|
|
|
|
|
{ |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(0,testCharacter.strength); |
|
|
|
|
|
setCharacterStrength(&testCharacter,50); |
|
|
|
|
|
TEST_ASSERT_EQUAL_INT(50,testCharacter.strength); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |