Skip to content

Add attribute telling the debugger not to evaluate destructive properties#5001

Merged
manfred-brands merged 3 commits into
mainfrom
Issue4994-4995_SideEffectsInDebugger
Jun 23, 2025
Merged

Add attribute telling the debugger not to evaluate destructive properties#5001
manfred-brands merged 3 commits into
mainfrom
Issue4994-4995_SideEffectsInDebugger

Conversation

@manfred-brands

Copy link
Copy Markdown
Member

Fixes #4994
Fixes #4995

@manfred-brands manfred-brands self-assigned this Jun 21, 2025
@manfred-brands manfred-brands force-pushed the Issue4994-4995_SideEffectsInDebugger branch from 8c100d9 to aa029e0 Compare June 21, 2025 08:59
@stevenaw

stevenaw commented Jun 21, 2025

Copy link
Copy Markdown
Member

Thanks for fixing this @manfred-brands
This looks good to me. Just for the sake of considering all sides, do we think there's a chance anyone was reliant on our override of ToString() ?

EDIT: I agree the existing implementation can be problematic. I'm thinking instead about if it's worth a dedicated call-out in any release notes about it

@OsirisTerje Any concerns about this going into 4.4?

Comment thread src/NUnitFramework/tests/Assertions/AssertThatTests.cs Outdated
@manfred-brands

Copy link
Copy Markdown
Member Author

do we think there's a chance anyone was reliant on our override of ToString() ?

The constraint doesn't work correctly anymore after calling that method, so I would say not.

@stevenaw

Copy link
Copy Markdown
Member

Thanks @manfred-brands
I agree it's pretty unlikely outside perhaps the testing of custom constraints, similar to the usage in NUnit's suite.

@manfred-brands manfred-brands merged commit 5d07998 into main Jun 23, 2025
5 checks passed
@manfred-brands manfred-brands deleted the Issue4994-4995_SideEffectsInDebugger branch June 23, 2025 00:40
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.

Check and fix properties for sideeffects Fix or remove ToString in class ConstraintExpression

3 participants