Skip to content

[hardening] Add OpenXmlMarkupService unit tests (comments + tracked changes fidelity) #56

@MTCMarkFranco

Description

@MTCMarkFranco

Enhancement

LambdaRag.Markup (the most user-visible output module) has no direct unit tests. Existing coverage:

  • Markup/AnnotationFactoryPassTests.cs — exercises annotation construction, not docx output.
  • Markup/CommentFormattingTests.cs — exercises text-level comment formatting only.
  • tests/.../ReviewedDocxIdempotency.cs — verifies byte-stability but not correctness of comment / ins / del placement.

Goal: A focused OpenXmlMarkupServiceTests suite that loads a small fixture docx, applies a known annotation set, opens the output with OpenXml, and asserts:

  • Comment count and IDs match expected.
  • Comment.Author, Comment.Initials, Comment.Date set to expected (deterministic) values.
  • CommentRangeStart / CommentRangeEnd brackets enclose the expected run text.
  • InsertedRun text matches Annotation.Replacement.
  • DeletedRun text matches the original span text (depends on [hardening] DeletedRun writes literal '[deleted]' instead of original span text #53).
  • Output is byte-identical across two runs (idempotency, narrower fixture than the existing test).

Out of scope

  • End-to-end pipeline tests (already covered in integration suite).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmodalityOutput modality (report/markup/UI/API)phase-1-pattern-defPhase 1: Pattern definition (writing)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions