From d260ad59d57e2ba7ae9f72e46ee51c493889f8df Mon Sep 17 00:00:00 2001 From: Saba Fazlali Date: Thu, 8 Feb 2024 21:03:55 +0100 Subject: [PATCH] test displayRules --- test/Hangman/test_initializeHangman.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/Hangman/test_initializeHangman.c diff --git a/test/Hangman/test_initializeHangman.c b/test/Hangman/test_initializeHangman.c new file mode 100644 index 0000000..9b5238b --- /dev/null +++ b/test/Hangman/test_initializeHangman.c @@ -0,0 +1,23 @@ +#include +#include "playHangman.h" + + +void test_displayRules() { + printf("Test Case 1: User inputs '1'\n"); + printf("Expected Output: 'Let's get started!'\n"); + printf("Actual Output: "); + printf("1\n"); + displayRules(); + + printf("\nTest Case 2: User inputs '2'\n"); + printf("Expected Output: Output of printRules() function\n"); + printf("Actual Output: "); + printf("2\n"); + displayRules(); + + printf("\nTest Case 3: User inputs invalid value\n"); + printf("Expected Output: 'Please enter either 1 or 2 to continue'\n"); + printf("Actual Output: "); + printf("invalid\n"); + displayRules(); +}