Skip to content

Support ShouldMatchApproved for byte arrays#833

Open
Shane32 wants to merge 1 commit into
shouldly:masterfrom
Shane32:shouldmatchapproved_bytes
Open

Support ShouldMatchApproved for byte arrays#833
Shane32 wants to merge 1 commit into
shouldly:masterfrom
Shane32:shouldmatchapproved_bytes

Conversation

@Shane32
Copy link
Copy Markdown
Contributor

@Shane32 Shane32 commented Jan 11, 2022

I'd like to use ShouldMatchApproved for binary data - in my scenario, comparing a generated PDF file to a known good file. Attached is a PR to make ShouldMatchApproved support byte arrays.

Considerations:

  • Proper message to be displayed when data does not match? Now it just writes "does not match".
  • Use existing builder configuration? Now it ignores string-specific settings - case sensitivity, scrubber, line endings.
  • Default extension is still 'txt' but probably should be 'dat'. How to support this with current infrastructure? Change default file extension to null, then set to 'txt' or 'dat' within ShouldMatchApproved method?
  • Should diff launcher be used? Currently yes.
  • Support for Stream rather than just byte[]? Currently no.
  • What tests need to be included for this?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant