From d3f2d7ec6b0db70895a3568608827bd8a157e96e Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Wed, 7 Feb 2024 15:46:08 +0000 Subject: [PATCH] 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. --- src/test/c/test_taschenrechner.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/c/test_taschenrechner.c b/src/test/c/test_taschenrechner.c index f51aaad..65e544f 100644 --- a/src/test/c/test_taschenrechner.c +++ b/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