Reverse scrubbing? #1345
-
I just got introduced to this great library and I have a question regarding scrubbing: When I saw scrubbing was an option, I thought the workflow for a new test was:
But this isn't how it actually works turns out (unless I'm missing something) 🙃 From what I understand, scrubbing works primarily on cleaning the For our use case, the existing scrubbing functionality is hard to get right as our objects look like this (for example):
So the ID property differs every call, so must be scrubbed. However, the TypeID property is always the same and is something we want to verify. Initially I figured I would check if something looked like an ID and could be parsed as a What I would like to be able to do is manually edit the
And at comparison time, any members in the Is this something that would be feasible to add, or is this perhaps already supported somehow, or even a better way to do what I want? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
@JulianRooze not sure about "reverse scrubbing" that sounds difficult to implement. But you should be able to easily scrub the id using |
Beta Was this translation helpful? Give feedback.
-
This is timely! I was just looking at finally updating Verify on a project that's stuck back on an old version when scrubbing of "NumericIds" was still a thing. That feature used to replace the values with say Id_1, Id_2, etc but was likely removed because the counter potentially replaced occurrences of the same id value with the same replacement value, and that could be a problem in integration tests with dynamic ids depending on what you subset of tests you ran and if ids overlapped across tables for instance. PR looks good, the string overload would be good enough for me and the MemberInfo is a nice to have but since that's already been reflected wouldn't seem to impact perf. |
Beta Was this translation helpful? Give feedback.
how about this as a solution