From 283834c8f6c6e302ab522bb2a4f47583098ad6e8 Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Wed, 7 Feb 2024 16:02:27 +0000 Subject: [PATCH] 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. --- src/test/c/test_taschenrechner.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/c/test_taschenrechner.c b/src/test/c/test_taschenrechner.c index 38ccd8e..39414dd 100644 --- a/src/test/c/test_taschenrechner.c +++ b/src/test/c/test_taschenrechner.c @@ -192,4 +192,16 @@ void test_performOperation_Multiplication(void) { 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