Skip to content

Conversation

@Evangelink
Copy link
Member

Fixes #6690

# Conflicts:
#	src/TestFramework/TestFramework/Resources/FrameworkMessages.resx
#	test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.That.cs
@Evangelink Evangelink enabled auto-merge (squash) November 25, 2025 13:28
@nohwnd nohwnd disabled auto-merge November 25, 2025 16:35
@nohwnd
Copy link
Member

nohwnd commented Nov 25, 2025

disabled automerge, I want to do some more testing, but now don't have any inspiration. So plese wait for me a day or 2.

@nohwnd
Copy link
Member

nohwnd commented Nov 25, 2025

https://github.com/microsoft/testfx/compare/dev/amauryleve/assert-that...assert-that+objects?expand=1

When the method returns objects they will get merged in the cache, and only 1 instance is returned. Making it impossible to see what was returned.

It probably needs to serialize the objects for the assertion as it goes, adding overhead for passing assertions, but also snapshotting the values better.

Also this would avoid issues with the object overriding equals / gethash, when we grab it from the cache?

image

The linked code returns 2 instances that have different data when they are evaluated, but I cannot see that from the output.

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.

Assert.That evaluates expression twice

4 participants