Skip to content

Add get_min_revenue_threshold and report_revenue interaction tests for boundary amounts #366

@thlpkee20-wq

Description

@thlpkee20-wq

Description

The min-revenue-threshold path in report_revenue emits rev_below and skips report/audit updates when amount < threshold, but boundary behavior (amount == threshold, threshold == 0, override of an already-persisted period below threshold) needs explicit coverage. Add a focused test matrix asserting state and emitted events at each boundary.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: src/lib.rs (report_revenue, set_min_revenue_threshold, get_min_revenue_threshold), src/test.rs
  • Verify override_existing=true still corrects below-threshold persisted periods

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/min-revenue-threshold-tests
  • Implement changes
    • Assert amount == threshold is accepted (not below)
    • Assert rev_below emitted and no AuditSummary mutation when below
    • Assert override of a persisted period bypasses the threshold
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test
  • Cover edge cases
    • threshold 0, threshold equal, threshold-minus-one, override below threshold
  • Include test output and security notes

Example commit message

test: cover min revenue threshold boundaries in report_revenue

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions