From 62b522558c546ea9c9533214082e27f3c6aeb71b Mon Sep 17 00:00:00 2001 From: Kai Kehres Date: Sat, 14 Jan 2023 17:59:03 +0100 Subject: [PATCH] refactoring: test combined the test_addCharacterHealthpoints and test_addCharacterStrength Unittests --- test/c/test_character.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/test/c/test_character.c b/test/c/test_character.c index 083b842..20d175c 100644 --- a/test/c/test_character.c +++ b/test/c/test_character.c @@ -31,11 +31,6 @@ void test_getCharacterHealthPoints (void) { 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) { TEST_ASSERT_EQUAL_INT(0,testCharacter.strength); setCharacterStrength(&testCharacter,50); @@ -46,11 +41,6 @@ void test_getCharacterStrength(void) { 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) { TEST_ASSERT_EQUAL_INT(0,testCharacter.dexterity); setCharacterDexterity(&testCharacter,50); @@ -71,4 +61,11 @@ void test_getCharacterIntelligence(void) { 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 \ No newline at end of file