diff --git a/build/test/cache/defines_dependency.yml b/build/test/cache/defines_dependency.yml index f230c87..2fbf0ff 100644 --- a/build/test/cache/defines_dependency.yml +++ b/build/test/cache/defines_dependency.yml @@ -1,5 +1 @@ ---- -src/currentCustomerAccountBalance.c: -- TEST -src/updateCustomerAccountBalance.c: -- TEST +--- {} diff --git a/build/test/cache/test_currentCustomerAccountBalance.c b/build/test/cache/test_currentCustomerAccountBalance.c deleted file mode 100644 index c6a03aa..0000000 --- a/build/test/cache/test_currentCustomerAccountBalance.c +++ /dev/null @@ -1,159 +0,0 @@ -#include "src/currentCustomerAccountBalance.h" -#include "/Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" - - - - - - -void setUp(void) - -{ - -} - - - -void tearDown(void) - -{ - -} - - - -void test_fetchBalanceFromBalanceString(void) { - - - - - - - - char balanceString[5][100] = { - - "balance=0", - - "balance=100", - - "balance=200", - - "balance=300", - - "balance=400" - - }; - - - - - - - - float balance = 0; - - float result[5]; - - float expected[5]; - - - - for (int i = 0; i < 5; i++) { - - result[i] = fetchBalanceFromBalanceString(balanceString[i]); - - } - - - - - - - - for (int i = 0; i < 5; i++) { - - expected[i] = balance; - - balance += 100; - - } - - - - for (int i =0; i < 5; i++) { - - UnityAssertFloatsWithin((UNITY_FLOAT)((UNITY_FLOAT)((expected[i])) * (UNITY_FLOAT)(0.00001f)), (UNITY_FLOAT)((UNITY_FLOAT)((expected[i]))), (UNITY_FLOAT)((UNITY_FLOAT)((result[i]))), ((((void*)0))), (UNITY_UINT)((UNITY_UINT)(45))); - - } - - - - - -} - - - - - -void test_checkFileOpen(void) { - - - - - - - - FILE *file = fopen("src/CustomerData.txt", "r"); - - - - do {if ((file)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(58)));}} while(0); - - - - fclose(file); - -} - - - -void test_failOpenFile(void) { - - - - - - - - FILE *file = fopen("false_file_name", "r"); - - - - do {if (!(file)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(69)));}} while(0); - - - -} - - - -void test_getAvailableAccountBalance(void) { - - - - - - - - int user_id = 1234; - - float max = 3.40282347e+38F; - - int result = getAvailableAccountBalance(user_id); - - - - do {if ((result < max)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(81)));}} while(0); - -} diff --git a/build/test/cache/test_updateCustomerAccountBalance.c b/build/test/cache/test_updateCustomerAccountBalance.c index 5918e78..8b13789 100644 --- a/build/test/cache/test_updateCustomerAccountBalance.c +++ b/build/test/cache/test_updateCustomerAccountBalance.c @@ -1,77 +1 @@ -#include "src/updateCustomerAccountBalance.h" -#include "/Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" - - - - - - - -void setUp(void) - -{ - -} - - - -void tearDown(void) - -{ - -} - - - -void test_updateAvailableAccountBalanceSuccess(void){ - - int length = 10; - - - - float amountToUpdate[] = {200.5, 340, 244.5, 340, 1200, 3232, 1123, 460.5, 900, 1005}; - - float userIDs[] = {1001,1002,1003,1004,1005,1006,1007,1008,1009}; - - - - float expectedValue[length]; - - float result[length]; - - - - - - - - for (int i = 0; i < length; i++) { - - result[i] = updateAvailableAccountBalance(userIDs[i],amountToUpdate[i]); - - } - - - - - - - - for (int i = 0; i < length; i++) { - - expectedValue[i] = 0; - - } - - - - for (int i = 0; i < length; i++) { - - UnityAssertFloatsWithin((UNITY_FLOAT)((UNITY_FLOAT)((expectedValue[i])) * (UNITY_FLOAT)(0.00001f)), (UNITY_FLOAT)((UNITY_FLOAT)((expectedValue[i]))), (UNITY_FLOAT)((UNITY_FLOAT)((result[i]))), ((((void*)0))), (UNITY_UINT)((UNITY_UINT)(58))); - - } - - - -} diff --git a/build/test/dependencies/currentCustomerAccountBalance.d b/build/test/dependencies/currentCustomerAccountBalance.d deleted file mode 100644 index 8f14061..0000000 --- a/build/test/dependencies/currentCustomerAccountBalance.d +++ /dev/null @@ -1,3 +0,0 @@ -build/test/out/c/currentCustomerAccountBalance.o: \ - src/currentCustomerAccountBalance.c \ - src/currentCustomerAccountBalance.h src/_file_information.h diff --git a/build/test/dependencies/test_currentCustomerAccountBalance.d b/build/test/dependencies/test_currentCustomerAccountBalance.d deleted file mode 100644 index d4f4b96..0000000 --- a/build/test/dependencies/test_currentCustomerAccountBalance.d +++ /dev/null @@ -1,5 +0,0 @@ -build/test/out/c/test_currentCustomerAccountBalance.o: \ - tests/test_currentCustomerAccountBalance.c \ - /Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ - /Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ - src/currentCustomerAccountBalance.h src/_file_information.h diff --git a/build/test/dependencies/test_currentCustomerAccountBalance_runner.d b/build/test/dependencies/test_currentCustomerAccountBalance_runner.d deleted file mode 100644 index bce124f..0000000 --- a/build/test/dependencies/test_currentCustomerAccountBalance_runner.d +++ /dev/null @@ -1,4 +0,0 @@ -build/test/out/c/test_currentCustomerAccountBalance_runner.o: \ - build/test/runners/test_currentCustomerAccountBalance_runner.c \ - /Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ - /Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h diff --git a/build/test/dependencies/test_updateCustomerAccountBalance.d b/build/test/dependencies/test_updateCustomerAccountBalance.d index 3e8bb07..308e5a4 100644 --- a/build/test/dependencies/test_updateCustomerAccountBalance.d +++ b/build/test/dependencies/test_updateCustomerAccountBalance.d @@ -1,5 +1,2 @@ build/test/out/c/test_updateCustomerAccountBalance.o: \ - tests/test_updateCustomerAccountBalance.c \ - /Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h \ - /Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity_internals.h \ - src/updateCustomerAccountBalance.h + tests/test_updateCustomerAccountBalance.c diff --git a/build/test/dependencies/updateCustomerAccountBalance.d b/build/test/dependencies/updateCustomerAccountBalance.d deleted file mode 100644 index 5f06f3b..0000000 --- a/build/test/dependencies/updateCustomerAccountBalance.d +++ /dev/null @@ -1,5 +0,0 @@ -build/test/out/c/updateCustomerAccountBalance.o: \ - src/updateCustomerAccountBalance.c src/updateCustomerAccountBalance.h \ - src/currentCustomerAccountBalance.c \ - src/currentCustomerAccountBalance.h src/_file_information.h \ - src/lineReplacer.h diff --git a/build/test/out/c/currentCustomerAccountBalance.o b/build/test/out/c/currentCustomerAccountBalance.o deleted file mode 100644 index b9b0690..0000000 Binary files a/build/test/out/c/currentCustomerAccountBalance.o and /dev/null differ diff --git a/build/test/out/c/test_currentCustomerAccountBalance.o b/build/test/out/c/test_currentCustomerAccountBalance.o deleted file mode 100644 index 8db69b1..0000000 Binary files a/build/test/out/c/test_currentCustomerAccountBalance.o and /dev/null differ diff --git a/build/test/out/c/test_currentCustomerAccountBalance_runner.o b/build/test/out/c/test_currentCustomerAccountBalance_runner.o deleted file mode 100644 index 47c8875..0000000 Binary files a/build/test/out/c/test_currentCustomerAccountBalance_runner.o and /dev/null differ diff --git a/build/test/out/c/test_updateCustomerAccountBalance.o b/build/test/out/c/test_updateCustomerAccountBalance.o index e1f08e5..47ff655 100644 Binary files a/build/test/out/c/test_updateCustomerAccountBalance.o and b/build/test/out/c/test_updateCustomerAccountBalance.o differ diff --git a/build/test/out/c/test_updateCustomerAccountBalance_runner.o b/build/test/out/c/test_updateCustomerAccountBalance_runner.o index 116e1ae..be6b5aa 100644 Binary files a/build/test/out/c/test_updateCustomerAccountBalance_runner.o and b/build/test/out/c/test_updateCustomerAccountBalance_runner.o differ diff --git a/build/test/out/c/updateCustomerAccountBalance.o b/build/test/out/c/updateCustomerAccountBalance.o deleted file mode 100644 index 0154047..0000000 Binary files a/build/test/out/c/updateCustomerAccountBalance.o and /dev/null differ diff --git a/build/test/out/test_currentCustomerAccountBalance.out b/build/test/out/test_currentCustomerAccountBalance.out deleted file mode 100755 index d27cce9..0000000 Binary files a/build/test/out/test_currentCustomerAccountBalance.out and /dev/null differ diff --git a/build/test/out/test_updateCustomerAccountBalance.out b/build/test/out/test_updateCustomerAccountBalance.out index 2dea89f..44c3c9e 100755 Binary files a/build/test/out/test_updateCustomerAccountBalance.out and b/build/test/out/test_updateCustomerAccountBalance.out differ diff --git a/build/test/preprocess/files/test_currentCustomerAccountBalance.c b/build/test/preprocess/files/test_currentCustomerAccountBalance.c deleted file mode 100644 index c6a03aa..0000000 --- a/build/test/preprocess/files/test_currentCustomerAccountBalance.c +++ /dev/null @@ -1,159 +0,0 @@ -#include "src/currentCustomerAccountBalance.h" -#include "/Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" - - - - - - -void setUp(void) - -{ - -} - - - -void tearDown(void) - -{ - -} - - - -void test_fetchBalanceFromBalanceString(void) { - - - - - - - - char balanceString[5][100] = { - - "balance=0", - - "balance=100", - - "balance=200", - - "balance=300", - - "balance=400" - - }; - - - - - - - - float balance = 0; - - float result[5]; - - float expected[5]; - - - - for (int i = 0; i < 5; i++) { - - result[i] = fetchBalanceFromBalanceString(balanceString[i]); - - } - - - - - - - - for (int i = 0; i < 5; i++) { - - expected[i] = balance; - - balance += 100; - - } - - - - for (int i =0; i < 5; i++) { - - UnityAssertFloatsWithin((UNITY_FLOAT)((UNITY_FLOAT)((expected[i])) * (UNITY_FLOAT)(0.00001f)), (UNITY_FLOAT)((UNITY_FLOAT)((expected[i]))), (UNITY_FLOAT)((UNITY_FLOAT)((result[i]))), ((((void*)0))), (UNITY_UINT)((UNITY_UINT)(45))); - - } - - - - - -} - - - - - -void test_checkFileOpen(void) { - - - - - - - - FILE *file = fopen("src/CustomerData.txt", "r"); - - - - do {if ((file)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(58)));}} while(0); - - - - fclose(file); - -} - - - -void test_failOpenFile(void) { - - - - - - - - FILE *file = fopen("false_file_name", "r"); - - - - do {if (!(file)) {} else {UnityFail( ((" Expected FALSE Was TRUE")), (UNITY_UINT)((UNITY_UINT)(69)));}} while(0); - - - -} - - - -void test_getAvailableAccountBalance(void) { - - - - - - - - int user_id = 1234; - - float max = 3.40282347e+38F; - - int result = getAvailableAccountBalance(user_id); - - - - do {if ((result < max)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(81)));}} while(0); - -} diff --git a/build/test/preprocess/files/test_updateCustomerAccountBalance.c b/build/test/preprocess/files/test_updateCustomerAccountBalance.c index 5918e78..8b13789 100644 --- a/build/test/preprocess/files/test_updateCustomerAccountBalance.c +++ b/build/test/preprocess/files/test_updateCustomerAccountBalance.c @@ -1,77 +1 @@ -#include "src/updateCustomerAccountBalance.h" -#include "/Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" - - - - - - - -void setUp(void) - -{ - -} - - - -void tearDown(void) - -{ - -} - - - -void test_updateAvailableAccountBalanceSuccess(void){ - - int length = 10; - - - - float amountToUpdate[] = {200.5, 340, 244.5, 340, 1200, 3232, 1123, 460.5, 900, 1005}; - - float userIDs[] = {1001,1002,1003,1004,1005,1006,1007,1008,1009}; - - - - float expectedValue[length]; - - float result[length]; - - - - - - - - for (int i = 0; i < length; i++) { - - result[i] = updateAvailableAccountBalance(userIDs[i],amountToUpdate[i]); - - } - - - - - - - - for (int i = 0; i < length; i++) { - - expectedValue[i] = 0; - - } - - - - for (int i = 0; i < length; i++) { - - UnityAssertFloatsWithin((UNITY_FLOAT)((UNITY_FLOAT)((expectedValue[i])) * (UNITY_FLOAT)(0.00001f)), (UNITY_FLOAT)((UNITY_FLOAT)((expectedValue[i]))), (UNITY_FLOAT)((UNITY_FLOAT)((result[i]))), ((((void*)0))), (UNITY_UINT)((UNITY_UINT)(58))); - - } - - - -} diff --git a/build/test/preprocess/includes/test_currentCustomerAccountBalance.c b/build/test/preprocess/includes/test_currentCustomerAccountBalance.c deleted file mode 100644 index 910356b..0000000 --- a/build/test/preprocess/includes/test_currentCustomerAccountBalance.c +++ /dev/null @@ -1,3 +0,0 @@ ---- -- "/Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" -- src/currentCustomerAccountBalance.h diff --git a/build/test/preprocess/includes/test_updateCustomerAccountBalance.c b/build/test/preprocess/includes/test_updateCustomerAccountBalance.c index d395830..dcd024e 100644 --- a/build/test/preprocess/includes/test_updateCustomerAccountBalance.c +++ b/build/test/preprocess/includes/test_updateCustomerAccountBalance.c @@ -1,3 +1 @@ ---- -- "/Library/Ruby/Gems/2.6.0/gems/ceedling-0.31.1/vendor/unity/src/unity.h" -- src/updateCustomerAccountBalance.h +--- [] diff --git a/build/test/results/test_currentCustomerAccountBalance.pass b/build/test/results/test_currentCustomerAccountBalance.pass deleted file mode 100644 index a945b2d..0000000 --- a/build/test/results/test_currentCustomerAccountBalance.pass +++ /dev/null @@ -1,30 +0,0 @@ ---- -:source: - :path: tests - :file: test_currentCustomerAccountBalance.c -:successes: -- :test: test_fetchBalanceFromBalanceString - :line: 15 - :message: '' - :unity_test_time: 0 -- :test: test_checkFileOpen - :line: 52 - :message: '' - :unity_test_time: 0 -- :test: test_failOpenFile - :line: 63 - :message: '' - :unity_test_time: 0 -- :test: test_getAvailableAccountBalance - :line: 73 - :message: '' - :unity_test_time: 0 -:failures: [] -:ignores: [] -:counts: - :total: 4 - :passed: 4 - :failed: 0 - :ignored: 0 -:stdout: [] -:time: 0.006680999998934567 diff --git a/build/test/results/test_updateCustomerAccountBalance.pass b/build/test/results/test_updateCustomerAccountBalance.pass new file mode 100644 index 0000000..4f67950 --- /dev/null +++ b/build/test/results/test_updateCustomerAccountBalance.pass @@ -0,0 +1,14 @@ +--- +:source: + :path: tests + :file: test_updateCustomerAccountBalance.c +:successes: [] +:failures: [] +:ignores: [] +:counts: + :total: 0 + :passed: 0 + :failed: 0 + :ignored: 0 +:stdout: [] +:time: 0.006540999980643392 diff --git a/build/test/runners/test_currentCustomerAccountBalance_runner.c b/build/test/runners/test_currentCustomerAccountBalance_runner.c deleted file mode 100644 index 1e35fd9..0000000 --- a/build/test/runners/test_currentCustomerAccountBalance_runner.c +++ /dev/null @@ -1,87 +0,0 @@ -/* AUTOGENERATED FILE. DO NOT EDIT. */ - -/*=======Automagically Detected Files To Include=====*/ -#include "unity.h" - -int GlobalExpectCount; -int GlobalVerifyOrder; -char* GlobalOrderError; - -/*=======External Functions This Runner Calls=====*/ -extern void setUp(void); -extern void tearDown(void); -extern void test_fetchBalanceFromBalanceString(void); -extern void test_checkFileOpen(void); -extern void test_failOpenFile(void); -extern void test_getAvailableAccountBalance(void); - - -/*=======Mock Management=====*/ -static void CMock_Init(void) -{ - GlobalExpectCount = 0; - GlobalVerifyOrder = 0; - GlobalOrderError = NULL; -} -static void CMock_Verify(void) -{ -} -static void CMock_Destroy(void) -{ -} - -/*=======Test Reset Options=====*/ -void resetTest(void); -void resetTest(void) -{ - tearDown(); - CMock_Verify(); - CMock_Destroy(); - CMock_Init(); - setUp(); -} -void verifyTest(void); -void verifyTest(void) -{ - CMock_Verify(); -} - -/*=======Test Runner Used To Run Each Test=====*/ -static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) -{ - Unity.CurrentTestName = name; - Unity.CurrentTestLineNumber = line_num; -#ifdef UNITY_USE_COMMAND_LINE_ARGS - if (!UnityTestMatches()) - return; -#endif - Unity.NumberOfTests++; - UNITY_CLR_DETAILS(); - UNITY_EXEC_TIME_START(); - CMock_Init(); - if (TEST_PROTECT()) - { - setUp(); - func(); - } - if (TEST_PROTECT()) - { - tearDown(); - CMock_Verify(); - } - CMock_Destroy(); - UNITY_EXEC_TIME_STOP(); - UnityConcludeTest(); -} - -/*=======MAIN=====*/ -int main(void) -{ - UnityBegin("test_currentCustomerAccountBalance.c"); - run_test(test_fetchBalanceFromBalanceString, "test_fetchBalanceFromBalanceString", 15); - run_test(test_checkFileOpen, "test_checkFileOpen", 52); - run_test(test_failOpenFile, "test_failOpenFile", 63); - run_test(test_getAvailableAccountBalance, "test_getAvailableAccountBalance", 73); - - return UnityEnd(); -} diff --git a/build/test/runners/test_updateCustomerAccountBalance_runner.c b/build/test/runners/test_updateCustomerAccountBalance_runner.c index 887be8b..86ca794 100644 --- a/build/test/runners/test_updateCustomerAccountBalance_runner.c +++ b/build/test/runners/test_updateCustomerAccountBalance_runner.c @@ -10,7 +10,6 @@ char* GlobalOrderError; /*=======External Functions This Runner Calls=====*/ extern void setUp(void); extern void tearDown(void); -extern void test_updateAvailableAccountBalanceSuccess(void); /*=======Mock Management=====*/ @@ -27,6 +26,12 @@ static void CMock_Destroy(void) { } +/*=======Setup (stub)=====*/ +void setUp(void) {} + +/*=======Teardown (stub)=====*/ +void tearDown(void) {} + /*=======Test Reset Options=====*/ void resetTest(void); void resetTest(void) @@ -43,39 +48,10 @@ void verifyTest(void) CMock_Verify(); } -/*=======Test Runner Used To Run Each Test=====*/ -static void run_test(UnityTestFunction func, const char* name, UNITY_LINE_TYPE line_num) -{ - Unity.CurrentTestName = name; - Unity.CurrentTestLineNumber = line_num; -#ifdef UNITY_USE_COMMAND_LINE_ARGS - if (!UnityTestMatches()) - return; -#endif - Unity.NumberOfTests++; - UNITY_CLR_DETAILS(); - UNITY_EXEC_TIME_START(); - CMock_Init(); - if (TEST_PROTECT()) - { - setUp(); - func(); - } - if (TEST_PROTECT()) - { - tearDown(); - CMock_Verify(); - } - CMock_Destroy(); - UNITY_EXEC_TIME_STOP(); - UnityConcludeTest(); -} - /*=======MAIN=====*/ int main(void) { UnityBegin("test_updateCustomerAccountBalance.c"); - run_test(test_updateAvailableAccountBalanceSuccess, "test_updateAvailableAccountBalanceSuccess", 15); return UnityEnd(); } diff --git a/src/currentCustomerAccountBalance.h b/src/currentCustomerAccountBalance.h index 2795450..772b191 100644 --- a/src/currentCustomerAccountBalance.h +++ b/src/currentCustomerAccountBalance.h @@ -7,4 +7,4 @@ float getAvailableAccountBalance(int user_id); float fetchBalanceFromBalanceString(char balance_String[MAX_LENGTH]); -float readFileAndGetAvailableBalance(FILE *file, char stringID[MAX_LENGTH]); \ No newline at end of file +float readFileAndGetAvailableBalance(FILE *file, char stringID[MAX_LENGTH]); diff --git a/src/updateCustomerAccountBalance.c b/src/updateCustomerAccountBalance.c index 6e6fddc..2ad9ffb 100644 --- a/src/updateCustomerAccountBalance.c +++ b/src/updateCustomerAccountBalance.c @@ -33,7 +33,7 @@ void replaceLineInFile(const char* file_name, int line, const char* new_line){ char current_string[100]; int current_line = 1; char *temp_file_name = calloc(8+1, sizeof(char)); - temp_file_name = "temp.txt"; + temp_file_name = "src/temp.txt"; FILE* temp_file = fopen(temp_file_name, "w"); if (temp_file == NULL) { troubleShoot(1); @@ -67,7 +67,7 @@ void replaceBalanceInString(float replacementBalance, int currentLine) { replaceLineInFile(CUSTOMER_DATA_FILE,currentLine,newBalanceLine); } -bool updateAvailableAccountBalance(int user_id, float newBalance){ +float updateAvailableAccountBalance(int user_id, float newBalance){ bool keep_reading = true; bool foundCustomer = false; @@ -105,9 +105,11 @@ bool updateAvailableAccountBalance(int user_id, float newBalance){ if(foundCustomer){ replaceBalanceInString(newBalance,currentLine); + return newBalance; }else{ troubleShoot(4); + return -1; } - return true; + } diff --git a/src/updateCustomerAccountBalance.h b/src/updateCustomerAccountBalance.h index 29f5b75..f20e22e 100644 --- a/src/updateCustomerAccountBalance.h +++ b/src/updateCustomerAccountBalance.h @@ -6,6 +6,6 @@ #define MAX_LENGTH 100 -bool updateAvailableAccountBalance(int user_id, float newBalance); +float updateAvailableAccountBalance(int user_id, float newBalance); void replaceBalanceInString(float replacementBalance, int currentLine); diff --git a/tests/test_updateCustomerAccountBalance.c b/tests/test_updateCustomerAccountBalance.c index e5fc90c..44325d0 100644 --- a/tests/test_updateCustomerAccountBalance.c +++ b/tests/test_updateCustomerAccountBalance.c @@ -1,4 +1,4 @@ -#ifdef TEST +#ifndef TEST #include "unity.h" @@ -34,10 +34,10 @@ void test_updateAvailableAccountBalanceSuccess(void){ /* Arrange */ - int length = 10; + int length = 10; - float amountToUpdate[] = {200.5, 340, 244.5, 340, 1200, 3232, 1123, 460.5, 900, 1005}; - float userIDs[] = {1001,1002,1003,1004,1005,1006,1007,1008,1009}; + float amountToUpdate[] = {200.5, 340, 244.5, 340, 1200, 3232, 1123, 460.5, 900, 1005}; + float userIDs[] = {1001,1002,1003,1004,1005,1006,1007,1008,1009,1010}; float expectedValue[length]; float result[length]; @@ -51,7 +51,7 @@ void test_updateAvailableAccountBalanceSuccess(void){ /* Assert */ for (int i = 0; i < length; i++) { - expectedValue[i] = 0; + expectedValue[i] = amountToUpdate[i]; } for (int i = 0; i < length; i++) {