@ -23,4 +23,9 @@ void setFullName(Weapon *weapon, char *fullNameToSet)
int getTypeID(Weapon *weapon)
{
return weapon->typeID;
}
void setTypeID(Weapon *weapon, int typeToSet)
weapon->typeID = typeToSet;
@ -25,5 +25,6 @@ char *getFullName(Weapon *weapon);
void setFullName(Weapon *weapon, char *fullNameToSet);
int getTypeID(Weapon *weapon);
void setTypeID(Weapon *weapon, int typeToSet);
#endif
@ -99,4 +99,21 @@ void test_getTypeID(void)
TEST_ASSERT_EQUAL(type, result);
void test_setTypeID(void)
// arrange
int type = 2, result;
// act
Weapon test;
setTypeID(&test, type);
result = test.typeID;
// output
printf("setTypeID | typeID set to: %d -> after set: %d", type, result);
// assert
#endif // TEST