Your line manager has instructed you to write unit tests to determine the code coverage in the student management application. You are required to create a test package within the application you created in Section A, which will contain the required unit tests.

You are required to write the following unit tests:
Test Name
TestSaveStudent()
Test Purpose
To supply the student ID, name, age, email, and course to the save student method. The test will determine whether the correct student will be saved to memory.
TestSearchStudent ()
To supply the student id to the search student method. The test will determine that the correct student details have been returned.
TestSearchStudent_StudentNotFound()
TestDeleteStudent()
To supply an incorrect student ID to the search student method. The test will determine that no student was found.
To supply the student ID to the delete student method. The test will determine that the student has been successfully deleted.
TestDeleteStudent_StudentNotFound()
To supply an incorrect student ID to the delete student method. The test will determine that no student could be found to deleteTestStudentAge_StudentAgeValid()
To supply a valid student age to the student age method. The test will determine that the student’s age is valid.
TestStudentAge_StudentAgeInvalid()
To supply an invalid student age to the student age method. The test will determine that the student’s age is less than 16.
TestStudentAge_StudentAgeInvalidCharacter()
To supply an invalid character to the student age method. The test will determine that the student age supplied is not a number.

1 answer

TestSaveStudent():
Test Purpose:
To supply the student ID, name, age, email, and course to the save student method. The test will determine whether the correct student will be saved to memory.

TestSearchStudent():
Test Purpose:
To supply the student ID to the search student method. The test will determine that the correct student details have been returned.

TestSearchStudent_StudentNotFound():
Test Purpose:
To supply an incorrect student ID to the search student method. The test will determine that no student was found.

TestDeleteStudent():
Test Purpose:
To supply the student ID to the delete student method. The test will determine that the student has been successfully deleted.

TestDeleteStudent_StudentNotFound():
Test Purpose:
To supply an incorrect student ID to the delete student method. The test will determine that no student could be found to delete.

TestStudentAge_StudentAgeValid():
Test Purpose:
To supply a valid student age to the student age method. The test will determine that the student’s age is valid.

TestStudentAge_StudentAgeInvalid():
Test Purpose:
To supply an invalid student age to the student age method. The test will determine that the student’s age is less than 16.

TestStudentAge_StudentAgeInvalidCharacter():
Test Purpose:
To supply an invalid character to the student age method. The test will determine that the student age supplied is not a number.

Please note that the test package should be created within the application and the specified unit tests should be implemented accordingly.