Skip to content

Add unit tests for carrier-selection edge cases #1

Description

@mkarson1997

Goal

Turn the carrier-selection logic into an explicitly tested engineering artifact.

Completed

  • Added dedicated CargoAPI.Tests xUnit project.
  • Added Moq-based isolation for repository dependencies.
  • Non-positive desi rejects without persistence.
  • Exact lower boundary is covered.
  • Exact upper boundary is covered.
  • Multiple matching configurations select the cheapest carrier.
  • Documented above-range extra-desi example is covered (13, max 10, base 32, plus 444).
  • Missing carrier configuration fails without persistence.
  • Unit tests run in GitHub Actions and the latest CI is green.
  • README documents the automated test command.

Remaining edge cases

  • Inactive carrier configurations at the repository/integration boundary.
  • Equal-price/tie behavior if product policy requires deterministic selection.
  • Below-all-ranges behavior after the domain rule is explicitly decided.
  • Gap-between-ranges behavior after the domain rule is explicitly decided.

The two undefined pricing cases are tracked separately in issue #3 so tests do not accidentally freeze an unintended business rule.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions