Browse Source

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

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

12
src/test/c/test_taschenrechner.c

@ -180,4 +180,16 @@ void test_performOperation_Subtraction(void) {
TEST_ASSERT_EQUAL_INT(7, result); TEST_ASSERT_EQUAL_INT(7, result);
} }
// Test case for multiplication
void test_performOperation_Multiplication(void) {
// Arrange
int result;
// Act
result = performOperation(4, '*', 6);
// Assert
TEST_ASSERT_EQUAL_INT(24, result);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save