From 0436d72f1e4ac7697d7e0564c7fa547154163fae Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Wed, 7 Feb 2024 15:51:09 +0000 Subject: [PATCH] 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. --- 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 75a0bd3..38ccd8e 100644 --- a/src/test/c/test_taschenrechner.c +++ b/src/test/c/test_taschenrechner.c @@ -180,4 +180,16 @@ void test_performOperation_Subtraction(void) { 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