[Appointments] - Write Failing DB Tests for CRUD Operations #122

Closed
opened 2025-11-05 20:49:56 +00:00 by duarteneves5 · 0 comments
duarteneves5 commented 2025-11-05 20:49:56 +00:00 (Migrated from github.com)

Following TDD, write tests before implementation. These tests will fail, as the interface methods are empty.

Tasks:

  • Set up the pytest file (e.g., tests/test_vehicle_repo.py).
  • Create database fixtures (e.g., a test database, a sample client fixture, a sample vehicle fixture).
  • Write a test for test_create_appointment_success.
  • Write a test for test_get_appointment_by_id_success.
  • Write a test for test_get_appointment_by_id_not_found.
  • Write a test for test_get_appointments_by_vehicle_id_returns_list.
  • Write a test for test_get_appointments_by_client_id_returns_list.
  • Write a test for test_update_appointment_success (e.g., updating status).
  • Write a test for test_delete_appointment_success.
  • Run pytest and confirm all new tests fail as expected.
Following TDD, write tests *before* implementation. These tests will fail, as the interface methods are empty. **Tasks:** - [ ] Set up the `pytest` file (e.g., `tests/test_vehicle_repo.py`). - [ ] Create database fixtures (e.g., a test database, a sample `client` fixture, a sample `vehicle` fixture). - [ ] Write a test for `test_create_appointment_success`. - [ ] Write a test for `test_get_appointment_by_id_success`. - [ ] Write a test for `test_get_appointment_by_id_not_found`. - [ ] Write a test for `test_get_appointments_by_vehicle_id_returns_list`. - [ ] Write a test for `test_get_appointments_by_client_id_returns_list`. - [ ] Write a test for `test_update_appointment_success` (e.g., updating `status`). - [ ] Write a test for `test_delete_appointment_success`. - [ ] Run `pytest` and confirm all new tests fail as expected.
Sign in to join this conversation.
No description provided.