Browse Source

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

remotes/origin/kabrel
fdai7782 11 months ago
parent
commit
4152c3894e
  1. 10
      src/test/c/test_taschenrechner.c

10
src/test/c/test_taschenrechner.c

@ -168,6 +168,16 @@ void test_performOperation_Addition(void) {
TEST_ASSERT_EQUAL_INT(8, result); TEST_ASSERT_EQUAL_INT(8, result);
} }
// Test case for subtraction
void test_performOperation_Subtraction(void) {
// Arrange
int result;
// Act
result = performOperation(10, '-', 3);
// Assert
TEST_ASSERT_EQUAL_INT(7, result);
}
#endif // TEST #endif // TEST
Loading…
Cancel
Save