Skip to content

Latest commit

 

History

History
21 lines (11 loc) · 962 Bytes

File metadata and controls

21 lines (11 loc) · 962 Bytes

Unit Test Class : TestExpenses

Why This Function Can Produce Unexpected Output

The remaining_budget() method calculates how much of the budget is left after accounting for expenses. If an invalid or negative expense is added, or if categories are misused, this function could return misleading values.

What We Tested

  1. Correct calculation with known expenses.
  2. Unexpected categories: when a user adds a category not predefined (e.g., "shopping"), it should go into "other".
  3. Negative values: if a user adds a negative amount by mistake, it can artificially inflate the remaining budget.

Summary

These tests help ensure that budgeting calculations remain logical even in edge cases, like unexpected input or human error. A future improvement might be to prevent negative expenses altogether or warn the user.

Uni Test Class: TestTrip

Different test for the function in trip.py, to make sure they work as intended.