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

  1. Create a new Teacher object with valid information
  2. Call the createTeacher method on the TeacherServiceImpl with the Teacher object as the argument
  3. Verify that the teacherRepository.save method is called with the Teacher object
  4. Verify that the teacherRepository.save method is called only once
  5. 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

  1. Create a new Teacher object with valid information
  2. Call the createTeacher method on the TeacherServiceImpl with the Teacher object as the argument
  3. Call the getTeacherById method on the TeacherServiceImpl with the teacher's ID as the argument
  4. Verify that the teacherRepository.findById method is called with the teacher's ID
  5. Verify that the teacherRepository.findById method is called only once
  6. 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

  1. Create two Teacher objects with valid information.
  2. Create two Assignment objects, one for each teacher.
  3. Call the createTeacher method on the TeacherServiceImpl with the Teacher objects as arguments.
  4. Call the createAssignment method on the AssignmentServiceImpl with the Assignment objects as arguments.
  5. Call the updateAssignment method on the AssignmentServiceImpl for one teacher's assignment, passing in updated assignment details.
  6. Call the getAssignmentById method on the AssignmentServiceImpl for both assignments.
  7. Verify that the assignmentRepository.findById method is called for both assignments.
  8. Verify that the assignmentRepository.findById method is called twice for each assignment.
  9. Verify that the method returns the expected AssignmentDTO for both assignments.
  10. Call the deleteAssignment method on the AssignmentServiceImpl for the other teacher's assignment.
  11. Call the getAssignmentById method on the AssignmentServiceImpl for both assignments.
  12. Verify that the assignmentRepository.findById method is called for both assignments.
  13. Verify that the assignmentRepository.findById method is called twice for each assignment.
  14. 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

  1. Create a new Student object with valid information
  2. Call the createStudent method on the StudentServiceImpl with the Student object as the argument
  3. 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

  1. Create a new Teacher object with valid information
  2. Call the createTeacher method on the TeacherServiceImpl with the Teacher object as the argument
  3. Call the deleteTeacherById method on the TeacherServiceImpl with the teacher's ID as the argument
  4. Verify that the teacherRepository.deleteById method is called with the teacher's ID
  5. Verify that the teacherRepository.deleteById method is called only once
  6. Verify that the teacherService sends a confirmation email to the teacher's email address