diff --git a/.gitignore b/.gitignore deleted file mode 100644 index dce188f..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -.swp diff --git a/build-project.sh b/build-project.sh index 75d89ae..20a6d00 100755 --- a/build-project.sh +++ b/build-project.sh @@ -27,11 +27,6 @@ for file in employeeLogin.c mainMenu.c createEmployeeAccount.c; do cp "$file" "$file.bak" done -# replace .c with .h in respective files -#sed -i 's/createEmployeeAccount.c/createEmployeeAccount.h/g' mainMenu.c -#sed -i 's/showGeneralInfoEmployee.c/showGeneralInfoEmployee.h/g' employeeLogin.c -#sed -i 's/mainMenu.c/mainMenu.h/g' employeeLogin.c -#sed -i 's/employeeLogin.c/employeeLogin.h/g' createEmployeeAccount.c # remove 'src/' for file in employeeLogin.c createEmployeeAccount.c; do @@ -39,7 +34,7 @@ for file in employeeLogin.c createEmployeeAccount.c; do done -gcc mainMenu.c error.c createEmployeeAccount.c showGeneralInfoEmployee.c employeeLogin.c createCustomer.c helperFunctions.c loginCustomer.c customerMenu.c main.c calculatorAdd.c calculatorDivide.c calculatorFactorial.c calculatorGetUserInput.c calculatorGetUserInputFactorial.c calculatorMultiply.c calculatorSubtract.c displayMenuCalculator.c -o main +gcc mainMenu.c error.c createEmployeeAccount.c showGeneralInfoEmployee.c employeeLogin.c createCustomer.c helperFunctions.c loginCustomer.c customerMenu.c main.c calculatorAdd.c calculatorDivide.c calculatorFactorial.c calculatorGetUserInput.c calculatorGetUserInputFactorial.c calculatorMultiply.c calculatorSubtract.c displayMenuCalculator.c requestLoan.c -o main ./main rm main diff --git a/project.yml b/project.yml index 58b6e73..5c0d1db 100644 --- a/project.yml +++ b/project.yml @@ -49,7 +49,8 @@ - src/calculatorGetUserInputFactorial.* - src/calculatorMultiply.* - src/calculatorSubtract.* - - src/displazMenuCalculator.* + - src/displayMenuCalculator.* + - src/requestLoan.* :support: - tests/support :libraries: [] diff --git a/src/CustomerData.txt b/src/CustomerData.txt new file mode 100644 index 0000000..e2c3570 --- /dev/null +++ b/src/CustomerData.txt @@ -0,0 +1,7 @@ +4675275=1234 +ID=4675275 +Forename=Frank +Surname=Burkhardt +Password=1234 +Balance=50.0000€ + diff --git a/src/customerMenu.c b/src/customerMenu.c index b3bb522..49a8e19 100644 --- a/src/customerMenu.c +++ b/src/customerMenu.c @@ -22,7 +22,7 @@ int customerChoiceForMenuItem(int numberOfMenuItem) case 4: puts("You have chosen to request a loan.\n"); returnStatus = 4; - //call requestLoan(); + requestLoan(); break; default: puts("Invalid input."); diff --git a/src/customerMenu.h b/src/customerMenu.h index 4b51d22..482789b 100644 --- a/src/customerMenu.h +++ b/src/customerMenu.h @@ -1,6 +1,7 @@ #include #include #include "customerProperties.h" +#include "requestLoan.h" int customerChoiceForMenuItem(int); void showAllMenuEntries(); void menu(customer_t *); diff --git a/src/employeesCredentialsList.txt b/src/employeesCredentialsList.txt index a88ac1a..ed5a12d 100644 --- a/src/employeesCredentialsList.txt +++ b/src/employeesCredentialsList.txt @@ -9,86 +9,3 @@ Julius Insertcatfdai7057 Mohamed MDfdai6618 Shivam Schivam007fdlt3781 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -210960 fdai7207. - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/employeesData.txt b/src/employeesData.txt index bf7405b..16f8e9a 100644 --- a/src/employeesData.txt +++ b/src/employeesData.txt @@ -32,59 +32,3 @@ Name : Shivam Last name : Chaudhary Adress : Fulda,leipzigerstrasse,6 Phone number : +4918756871384 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/requestLoan.c b/src/requestLoan.c new file mode 100644 index 0000000..1398db6 --- /dev/null +++ b/src/requestLoan.c @@ -0,0 +1,29 @@ +#include "requestLoan.h" +const int a = 1; +int option1 = 1000; +int option2 = 2500; +int option3 = 5000; +char currency[] = "Euro"; +int allow() //int allow() is helpful for indirectly testing void requestLoan() +{ + if (a == 1) + { + return 1; + } +} + + +void requestLoan() +{ + if (allow() == 1) //only if int allow() returns 1, void requestLoan() will display the desired output + { + printf(" Please select a loan Package: \n"); + printf(" \n"); + printf(" \n"); + printf(" %d %s\n", option1, currency); + printf(" %d %s\n", option2, currency); + printf(" %d %s\n", option3, currency); + } +} + + diff --git a/src/requestLoan.h b/src/requestLoan.h new file mode 100644 index 0000000..e94f2c9 --- /dev/null +++ b/src/requestLoan.h @@ -0,0 +1,5 @@ +#include +#include + +void requestLoan(); +int allow(); \ No newline at end of file diff --git a/team.md b/team.md deleted file mode 100644 index 02580e9..0000000 --- a/team.md +++ /dev/null @@ -1,9 +0,0 @@ -# Bankmanagement-System - -- Can Hacioglu, Fdlt3817 -- Atharva Kishor Naik, fdai7514 -- Julius Philipp Engel, fdai7057 -- Shivam Chaudhary, fdlt3781 -- Mohamed Yahya Dahi, fdai6618 -- Haytham Daoula, fdai7207 - diff --git a/tests/test_CustomerMenu.c b/tests/test_CustomerMenu.c index 4ba1f23..96c3f9d 100644 --- a/tests/test_CustomerMenu.c +++ b/tests/test_CustomerMenu.c @@ -1,5 +1,6 @@ #include #include "../src/customerMenu.c" +#include "../src/requestLoan.c" void test_customerChoiceForMenuEntry() { diff --git a/tests/test_LoginCustomer.c b/tests/test_LoginCustomer.c index a3f945b..6daa70e 100644 --- a/tests/test_LoginCustomer.c +++ b/tests/test_LoginCustomer.c @@ -2,6 +2,7 @@ #include "../src/loginCustomer.c" #include "../src/customerMenu.c" #include "../src/helperFunctions.c" +#include "../src/requestLoan.c" #include "../src/error.c" void setUp(){}; void tearDown(){}; diff --git a/tests/test_mainMenu.c b/tests/test_mainMenu.c index c97c1b5..5df2c89 100644 --- a/tests/test_mainMenu.c +++ b/tests/test_mainMenu.c @@ -20,6 +20,7 @@ #include "../src/calculatorMultiply.c" #include "../src/calculatorSubtract.c" #include "../src/displayMenuCalculator.c" +#include "../src/requestLoan.c" void setUp(void) diff --git a/tests/test_requestLoan.c b/tests/test_requestLoan.c new file mode 100644 index 0000000..f845bd7 --- /dev/null +++ b/tests/test_requestLoan.c @@ -0,0 +1,23 @@ +#ifdef TEST + +#include "unity.h" + +#include "../src/requestLoan.c" + +void setUp(void) +{ +} + +void tearDown(void) +{ +} + +void test_requestLoan(void) +{ + int actual, expected; //Arrange + expected = 1; + actual = allow(); // Act + TEST_ASSERT_EQUAL_INT(expected, actual); // Assert +} + +#endif // TEST