Browse Source

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

remotes/origin/kabrel
fdai7782 11 months ago
parent
commit
d3f2d7ec6b
  1. 14
      src/test/c/test_taschenrechner.c

14
src/test/c/test_taschenrechner.c

@ -156,4 +156,18 @@ void test_exponentialFunction(void) {
TEST_ASSERT_EQUAL_FLOAT(1.0, exponentialFunction(0.0));
}
// addition with two numbers
void test_performOperation_Addition(void) {
// Arrange
int result;
// Act
result = performOperation(5, '+', 3);
// Assert
TEST_ASSERT_EQUAL_INT(8, result);
}
#endif // TEST
|||||||
100:0
Loading…
Cancel
Save