You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
552 B

  1. #ifdef TEST
  2. #include "unity.h"
  3. #include "checkLoanEligibility.h"
  4. void setUp(void)
  5. {
  6. }
  7. void tearDown(void)
  8. {
  9. }
  10. void test_checkLoanEligibilitySuccess(void) {
  11. /* Arrange */
  12. int user_id[3] = {1234, 1327, 1666}; // user_ids from file for testing
  13. bool result[3];
  14. /* Act */
  15. for (int i = 0; i < 3; i++) {
  16. result[i] = checkLoanEligibility(user_id[i]);
  17. }
  18. /* Assert */
  19. for (int i = 0; i < 3; i++) {
  20. TEST_ASSERT_TRUE(result[i]); // Pass if user_id is found in the file
  21. }
  22. }
  23. #endif // TEST