Test Scenarios - Anniegavr/Collab-Buddy GitHub Wiki
Scenario: An administrator is able to create a new account for another user.
Acceptance Criteria:
- The administrator should be able to enter their personal details and create a new account.
- The system should validate the user's information and display appropriate error messages if any information is missing or incorrect.
- Once the account is created, the new user should receive a confirmation email.
Test Plan
- Create a new Teacher object with valid information
- Call the createTeacher method on the TeacherServiceImpl with the Teacher object as the argument
- Verify that the teacherRepository.save method is called with the Teacher object
- Verify that the teacherRepository.save method is called only once
- Verify that the teacherService sends a confirmation email to the teacher's email address
Scenario: A teacher is able to view their own profile information.
Acceptance Criteria:
- Teacher should be able to view their own profile information.
- The system should display the teacher's personal details, such as their name, email address, and age.
Test Plan
- Create a new Teacher object with valid information
- Call the createTeacher method on the TeacherServiceImpl with the Teacher object as the argument
- Call the getTeacherById method on the TeacherServiceImpl with the teacher's ID as the argument
- Verify that the teacherRepository.findById method is called with the teacher's ID
- Verify that the teacherRepository.findById method is called only once
- Verify that the method returns the expected TeacherDTO
Scenario: Teacher can edit only their assignments
Acceptance Criteria:
- The teacher cannot edit or delete assignments created by other teachers.
- The teacher can edit the assignment details, such as the assignment name, description, and due date.
- When the teacher updates the assignment details, the changes are reflected in the system.
- The teacher can add or remove questions from the assignment.
Test Plan
- Create two Teacher objects with valid information.
- Create two Assignment objects, one for each teacher.
- Call the createTeacher method on the TeacherServiceImpl with the Teacher objects as arguments.
- Call the createAssignment method on the AssignmentServiceImpl with the Assignment objects as arguments.
- Call the updateAssignment method on the AssignmentServiceImpl for one teacher's assignment, passing in updated assignment details.
- Call the getAssignmentById method on the AssignmentServiceImpl for both assignments.
- Verify that the assignmentRepository.findById method is called for both assignments.
- Verify that the assignmentRepository.findById method is called twice for each assignment.
- Verify that the method returns the expected AssignmentDTO for both assignments.
- Call the deleteAssignment method on the AssignmentServiceImpl for the other teacher's assignment.
- Call the getAssignmentById method on the AssignmentServiceImpl for both assignments.
- Verify that the assignmentRepository.findById method is called for both assignments.
- Verify that the assignmentRepository.findById method is called twice for each assignment.
- Verify that the method returns the expected AssignmentDTO for the first assignment, but returns null for the second assignment.
Scenario: A teacher is able to search for students.
Acceptance Criteria:
- Teacher should be able to search for students by their name or email address.
- The system should display a list of all students that match the search criteria.
Test Plan
- Create a new Student object with valid information
- Call the createStudent method on the StudentServiceImpl with the Student object as the argument
- Call the dedicated method to find the student by different filters, like name, group, surname.
Scenario: A teacher is able to delete their own account.
Acceptance Criteria:
- Teacher should be able to delete their own account.
- The system should prompt the teacher to confirm the deletion.
- Once the account is deleted, the teacher should receive a confirmation email.
Test Plan
- Create a new Teacher object with valid information
- Call the createTeacher method on the TeacherServiceImpl with the Teacher object as the argument
- Call the deleteTeacherById method on the TeacherServiceImpl with the teacher's ID as the argument
- Verify that the teacherRepository.deleteById method is called with the teacher's ID
- Verify that the teacherRepository.deleteById method is called only once
- Verify that the teacherService sends a confirmation email to the teacher's email address