Skip to content

fix: RoundTrip_SaveRestore_CorrectOrder test assertions are broken #8

Description

@DanielKow

Problem

BlazorBlaze.Tests.VectorGraphics.Protocol.EncoderDecoderIntegrationTests.RoundTrip_SaveRestore_CorrectOrder fails on master (pre-existing, not introduced by any PR).

Failure:

Expected canvas.Operations to contain items {"Save", "SetMatrix"} in consecutive order,
but "SetMatrix" (index 1) did not appear (in the right consecutive order).

Root cause

Two wrong assertions:

  1. ContainInConsecutiveOrder("Save", "SetMatrix") — requires exact string equality, but the actual operation string is "SetMatrix(1.00,0.00,100.00,...)" with matrix parameters appended.
  2. canvas.Operations.Last().Should().Be("Restore") — RestoreContext emits a trailing SetMatrix to restore the saved transformation, so "Restore" is never the last operation.

Fix needed

Replace both assertions with predicate/index-based checks that match the actual operation string format:

  • Use IndexOf / FindIndex(op => op.StartsWith(...)) for ordering verification
  • Use Contain("Restore") instead of Last().Be("Restore")

Skipped in

PR #7 (epic-020 iter-21 bridge) — test skipped with [Skip] to unblock CI gate.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions