From db2b69a461f0cf5b4761f62994ba3463fe060500 Mon Sep 17 00:00:00 2001 From: fdai7057 Date: Fri, 10 Feb 2023 23:21:32 +0100 Subject: [PATCH] Implementation of unit tests for the function characterIsUpperCase(). --- tests/test_helperFunctions.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_helperFunctions.c b/tests/test_helperFunctions.c index 0b42d1a..aea1cf5 100644 --- a/tests/test_helperFunctions.c +++ b/tests/test_helperFunctions.c @@ -211,3 +211,18 @@ void test_generateCheckString() TEST_ASSERT_EQUAL_STRING(result_3[i],generateCheckString(random_numbers[i],strings_3[i])); } } + +void test_characterIsUpperCase() +{ + /*test values*/ + char c1 = 'x', c2 = 'y', c3 = 'z'; + char c4 = 'A', c5 = 'B', c6 = 'C'; + /*assertions*/ + TEST_ASSERT_FALSE(characterIsUpperCase(c1)); + TEST_ASSERT_FALSE(characterIsUpperCase(c2)); + TEST_ASSERT_FALSE(characterIsUpperCase(c3)); + TEST_ASSERT_TRUE(characterIsUpperCase(c4)); + TEST_ASSERT_TRUE(characterIsUpperCase(c5)); + TEST_ASSERT_TRUE(characterIsUpperCase(c6)); + +}