Browse Source

Added unittest for the case in to check the performOperation function's ability to perform division. Includes arranging operands, performing division, and asserting the expected result.

remotes/origin/kabrel
fdai7782 11 months ago
parent
commit
283834c8f6
  1. 12
      src/test/c/test_taschenrechner.c

12
src/test/c/test_taschenrechner.c

@ -192,4 +192,16 @@ void test_performOperation_Multiplication(void) {
TEST_ASSERT_EQUAL_INT(24, result); TEST_ASSERT_EQUAL_INT(24, result);
} }
// Test case for division
void test_performOperation_Division(void) {
// Arrange
int result;
// Act
result = performOperation(8, '/', 2);
// Assert
TEST_ASSERT_EQUAL_INT(4, result);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save