From 8274f848fd7810589911d16790c8371f624de453 Mon Sep 17 00:00:00 2001 From: Shivam Chaudhary Date: Sat, 4 Feb 2023 14:49:28 +0100 Subject: [PATCH] Implement test to check if the file opens --- tests/test_currentCustomerAccountBalance.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/test_currentCustomerAccountBalance.c b/tests/test_currentCustomerAccountBalance.c index 4b711b4..21d8cbc 100644 --- a/tests/test_currentCustomerAccountBalance.c +++ b/tests/test_currentCustomerAccountBalance.c @@ -12,8 +12,7 @@ void tearDown(void) { } -void test_fetchBalanceFromBalanceString(void) -{ +void test_fetchBalanceFromBalanceString(void) { char balanceString[5][100] = { "balance=0", "balance=100", @@ -43,4 +42,16 @@ void test_fetchBalanceFromBalanceString(void) } +void test_checkFileOpen(void) { + + FILE *file = fopen(CUSTOMER_DATA_FILE, "r"); + + TEST_ASSERT_TRUE(file); + + fclose(file); +} + + + + #endif // TEST