Skip to content

Integration test for the rating write path #34

Description

@elgorro

MatchRatingCalculator is covered by unit tests and the schema is verified by applying
the migrations, but the glue between them is not tested at all.

MatchQueries.CreateAsync derives the community and format from the teams, snapshots the
rule set, writes MatchAppearance rows, moves CommunityMember.Rating and sets
RatingAppliedAt. None of that is exercised against a real database.

There is no infrastructure test project to put such a test in, which is the first thing
this needs.

  • Add an integration test project running against Postgres (Testcontainers, or a
    service container in CI)
  • Cover: ratings move as the calculator says, appearances are written for both sides,
    the rule set is snapshotted onto the match, and the season is picked up
  • Cover the rejections: a team playing itself, teams from different communities, a
    player who is not a member of the community
  • Assert RatingAppliedAt makes a second application a no-op

Split out of #32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dataEF Core, DbContext and migrations (Ssabba.Infrastructure)area: domainEntities and rating maths (Ssabba.Domain)type: choreMaintenance, refactors, tooling

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions