Skip to content
Discussion options

You must be logged in to vote

Some of that probably comes down to the personal preferences and debugging approach of each developer. 😄 If the testing framework is expecting or needing a specific level for the desired functionality, I would suggest caching the current value, setting the needed value (in this case 2), then restoring the user's preference. That way the test can run consistently, regardless of what value the developer was using.

Just a tip on implementing this, I have found that it is usually much more performant to read the current value and only change if needed, rather than always setting the value. (Reads on property access tend to be much faster than writes.) Of course there is a balance between perf…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@joyfullservice
Comment options

Answer selected by josef-poetzl
@josef-poetzl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants