From 4152c3894edd0fc636231f82345d3ddbbaf6e790 Mon Sep 17 00:00:00 2001 From: fdai7782 Date: Wed, 7 Feb 2024 15:47:42 +0000 Subject: [PATCH] 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. --- src/test/c/test_taschenrechner.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/c/test_taschenrechner.c b/src/test/c/test_taschenrechner.c index 65e544f..75a0bd3 100644 --- a/src/test/c/test_taschenrechner.c +++ b/src/test/c/test_taschenrechner.c @@ -168,6 +168,16 @@ void test_performOperation_Addition(void) { 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