|
|
#ifndef TEST
#include "unity.h"
#include "updateCustomerAccountBalance.h"
void setUp(void) { }
void tearDown(void) { }
void test_updateAvailableAccountBalanceSuccess(void){
/*
int id1 = 1234; int id2 = 1327; int id3 = 1666;
int newBalance1=500; int newBalance2=800; int newBalance3=700;
bool results1=updateAvailableAccountBalance(id1,newBalance1); bool results2=updateAvailableAccountBalance(id2,newBalance2); bool results3=updateAvailableAccountBalance(id3,newBalance3);
TEST_ASSERT_TRUE(results1); TEST_ASSERT_TRUE(results2); TEST_ASSERT_TRUE(results3); */ /* Arrange */
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,1010};
float expectedValue[length]; float result[length];
/* Act */
for (int i = 0; i < length; i++) { result[i] = updateAvailableAccountBalance(userIDs[i],amountToUpdate[i]); }
/* Assert */
for (int i = 0; i < length; i++) { expectedValue[i] = amountToUpdate[i]; }
for (int i = 0; i < length; i++) { TEST_ASSERT_EQUAL_FLOAT(expectedValue[i],result[i]); } } #endif
|