Browse Source

refactoring: test combined the test_addCharacterHealthpoints and test_addCharacterStrength Unittests

remotes/origin/characterStats
Kai Kehres 2 years ago
parent
commit
62b522558c
  1. 17
      test/c/test_character.c

17
test/c/test_character.c

@ -31,11 +31,6 @@ void test_getCharacterHealthPoints (void) {
TEST_ASSERT_EQUAL_INT(15,testCharacter2.healthPoints); TEST_ASSERT_EQUAL_INT(15,testCharacter2.healthPoints);
} }
void test_addCharacterHealthPoints (void) {
increaseStat(&testCharacter2,HEALTHPOINTS,5);
TEST_ASSERT_EQUAL_INT(20,testCharacter2.healthPoints);
}
void test_setCharacterStrenght(void) { void test_setCharacterStrenght(void) {
TEST_ASSERT_EQUAL_INT(0,testCharacter.strength); TEST_ASSERT_EQUAL_INT(0,testCharacter.strength);
setCharacterStrength(&testCharacter,50); setCharacterStrength(&testCharacter,50);
@ -46,11 +41,6 @@ void test_getCharacterStrength(void) {
TEST_ASSERT_EQUAL_INT(5,testCharacter2.strength); TEST_ASSERT_EQUAL_INT(5,testCharacter2.strength);
} }
void test_addCharacterStrength (void) {
increaseStat(&testCharacter2,STRENGTH,5);
TEST_ASSERT_EQUAL_INT(10,testCharacter2.strength);
}
void test_setCharacterDexterity(void) { void test_setCharacterDexterity(void) {
TEST_ASSERT_EQUAL_INT(0,testCharacter.dexterity); TEST_ASSERT_EQUAL_INT(0,testCharacter.dexterity);
setCharacterDexterity(&testCharacter,50); setCharacterDexterity(&testCharacter,50);
@ -71,4 +61,11 @@ void test_getCharacterIntelligence(void) {
TEST_ASSERT_EQUAL_INT(7,testCharacter2.intelligence); TEST_ASSERT_EQUAL_INT(7,testCharacter2.intelligence);
} }
void test_increaseStat(void) {
increaseStat(&testCharacter2,STRENGTH,15);
TEST_ASSERT_EQUAL_INT(20,testCharacter2.strength);
increaseStat(&testCharacter2,INTELLIGENCE,15);
TEST_ASSERT_EQUAL_INT(22,testCharacter2.intelligence);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save