diff --git a/tests/test_createEmployeeAccount.c b/tests/test_createEmployeeAccount.c index 7cfdb5d..6d8ad91 100644 --- a/tests/test_createEmployeeAccount.c +++ b/tests/test_createEmployeeAccount.c @@ -55,20 +55,15 @@ void test_validEmployeePassword(void) char* validPassword [] = {"Atharva.123","02.September.2023","fdai7207.","array[20]","malloc(20*sizeof(int))","12.2E1234"}; int minimalLength = 8; + bool validPasswordexpectation = true; bool validPasswordResult[6]; - /*Act*/ + /*Act and Assert*/ for(int i=0; i<6; i++) { validPasswordResult[i] = isValidPassword(validPassword[i],minimalLength); - } - - /*Assert*/ - - for(int i=0; i<6; i++) - { - TEST_ASSERT_TRUE(validPasswordResult[i]); + TEST_ASSERT_EQUAL(validPasswordexpectation,validPasswordResult[i]); } } @@ -79,20 +74,15 @@ void test_invalidEmployeePassword(void) char* invalidPassword [] = {"fizzbuzzio","02.09.2023",".^^_*+/-.","RTX4050ti","Can","github.com/bankmanagement-system"}; int minimalLength = 8; + bool invalidPasswordexpected = false; bool invalidPasswordResult[6]; - /*Act*/ + /*Act and Assert*/ for(int i=0; i<6; i++) { invalidPasswordResult[i] = isValidPassword(invalidPassword[i],minimalLength); - } - - /*Assert*/ - - for(int i=0; i<6; i++) - { - TEST_ASSERT_FALSE(invalidPasswordResult[i]); + TEST_ASSERT_EQUAL(invalidPasswordexpected,invalidPasswordResult[i]); } }