[Invoices] - Write Failing DB Tests for CRUD Operations #117

Closed
opened 2025-11-05 20:35:37 +00:00 by duarteneves5 · 0 comments
duarteneves5 commented 2025-11-05 20:35:37 +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_invoice_success.
  • Write a test for test_get_invoice_by_id_success.
  • Write a test for test_get_invoice_by_id_not_found.
  • Write a test for test_get_invoices_by_client_id_returns_list.
  • Write a test for test_get_invoices_by_workOrder_id_returns_list.
  • Write a test for test_update_invoice_success (e.g., updating items).
  • Write a test for test_delete_invoice_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_invoice_success`. - [ ] Write a test for `test_get_invoice_by_id_success`. - [ ] Write a test for `test_get_invoice_by_id_not_found`. - [ ] Write a test for `test_get_invoices_by_client_id_returns_list`. - [ ] Write a test for `test_get_invoices_by_workOrder_id_returns_list`. - [ ] Write a test for `test_update_invoice_success` (e.g., updating `items`). - [ ] Write a test for `test_delete_invoice_success`. - [ ] Run `pytest` and confirm all new tests fail as expected.
Sign in to join this conversation.
No description provided.