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.

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.

To create the required unit tests, follow these steps:

1. Open the student management application project in your preferred IDE (Integrated Development Environment).

2. Create a new package in the application project and name it "test" or any appropriate name that indicates it contains the unit tests.

3. Inside the "test" package, create a new Java class for each of the unit tests you need to write. Name each class according to the corresponding test name mentioned in the task.

4. Open the "TestSaveStudent" class and implement the unit test method "TestSaveStudent()":

```java
import org.junit.Test;

public class TestSaveStudent {
@Test
public void TestSaveStudent() {
// Implement the test logic here
// Supply the student ID, name, age, email, and course to the save student method
// Verify that the correct student is saved to memory
}
}
```

5. Repeat step 4 for each of the remaining unit tests, creating a new class for each test and implementing the corresponding test logic.

Remember to import required packages and dependencies as necessary, such as JUnit, and modify the test logic according to your application's implementation.

Finally, run the unit tests to verify that they pass and provide the desired code coverage for the student management application.

Note: This is a general guide on how to write unit tests for the given test cases. The specific implementation details may vary depending on your application's code structure and testing framework.

To create the required unit tests for the student management application, you will need to follow these steps:

1. Open the application code file or project in your preferred Integrated Development Environment (IDE).
2. Create a new package to hold the unit tests. You can name this package "test" or any other suitable name.
3. Inside the test package, create a new Java class for each of the unit tests mentioned in the instructions. Each test class should have a meaningful name related to its purpose.
4. For example, for the test "TestSaveStudent()", create a class named "TestSaveStudent" inside the test package.
5. Inside each test class, write a test method using the JUnit testing framework (or any other testing framework you prefer).
6. For the "TestSaveStudent" method, you will need to supply the student ID, name, age, email, and course to the save student method. Then, assert that the correct student has been saved to memory.
- Use the appropriate assertions provided by the testing framework to check if the saved student matches the expected values.
7. Repeat this process for the remaining unit tests mentioned in the instructions, creating a new test method in the corresponding test class for each test.
8. In each test method, invoke the relevant method in the student management application being tested and verify the expected outcome.
9. For example, in the "TestSearchStudent" method, supply the student ID to the search student method and assert that the correct student details have been returned.
10. Remember to handle cases where the student is not found, as mentioned in tests like "TestSearchStudent_StudentNotFound" or "TestDeleteStudent_StudentNotFound".
11. Once you have completed writing all the unit tests, run the tests to check the code coverage and ensure they pass successfully.
12. You can do this by running the tests using the appropriate testing framework in your IDE or using the command-line tools provided by the framework.
13. The test results will indicate whether the code coverage is sufficient and if any issues or errors were encountered during testing.
14. If required, you can also consider adding additional unit tests or modifying the existing tests to achieve higher code coverage and accuracy in testing the student management application.

Note: The exact implementation of the unit tests will depend on the programming language and testing framework you are using. The steps provided here are generic and can be adapted to fit your specific development environment and requirements.