-
Notifications
You must be signed in to change notification settings - Fork 292
Improve assertions error messages with structured format #7444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Evangelink
wants to merge
47
commits into
main
Choose a base branch
from
dev/amauryleve/rework-assert
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,676
−4,109
Open
Changes from 17 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
8014b3c
Add assertion formatting helpers and localized resource strings
Evangelink b2127af
Improve AreEqual/AreNotEqual assertion error messages
Evangelink 9ac4849
Improve AreSame/AreNotSame assertion error messages
Evangelink 375f0b5
Improve IsTrue/IsFalse assertion error messages
Evangelink bd66356
Improve IsNull/IsNotNull assertion error messages
Evangelink 7e7f07e
Improve IsInstanceOfType/IsNotInstanceOfType assertion error messages
Evangelink bebe2ef
Improve IsExactInstanceOfType/IsNotExactInstanceOfType assertion erro…
Evangelink d35c33b
Improve IComparable assertion error messages
Evangelink 23758d2
Improve HasCount/IsEmpty/IsNotEmpty assertion error messages
Evangelink 3705c74
Improve ThrowsException assertion error messages
Evangelink 23cd627
Improve Contains/DoesNotContain/IsInRange assertion error messages
Evangelink dd88189
Improve StartsWith/DoesNotStartWith assertion error messages
Evangelink 0c10f63
Improve EndsWith/DoesNotEndWith assertion error messages
Evangelink 14a6ec3
Improve MatchesRegex/DoesNotMatchRegex assertion error messages
Evangelink 63e8257
Minor test cleanup for Inconclusive assertion
Evangelink f559387
Address Copilot feedback
Evangelink dfe9891
Fix acceptance tests
Evangelink 4422c82
Merge branch 'main' into dev/amauryleve/rework-assert
Evangelink f725f60
Fix diff caret position
Evangelink 9c96c9b
Use X more chars instead of total length
Evangelink 632c3c1
Use item instead of element
Evangelink fa263f2
Use more items
Evangelink 2822182
Updates
Evangelink 39b59eb
Simplify user message handling
Evangelink 60d17a9
Update hash text
Evangelink 44c6ca1
Improve
Evangelink 2610e3a
Move expressions to first line
Evangelink a402e6d
Avoid using wildcard in expected message
Evangelink 8eae1b2
Merge main into dev/amauryleve/rework-assert
Evangelink 2028446
Remove redundant item count from fully-displayed collections
Evangelink 52d43b7
Display null instead of (null) for null values in assertions
Evangelink 6222540
Use consistent angle bracket format for type display in assertions
Evangelink 6b1cf89
Remove angle brackets around delta values in equality assertion messages
Evangelink 08fb47e
Fix trailing newlines in test files
Evangelink 7f4294e
Materialize non-ICollection enumerables at assertion boundary to prev…
Evangelink 26f5c02
WIP: In-progress assertion changes before refactor
Evangelink 99b4922
Refactor assertion error messages with structured format
Evangelink edc1aa1
Add C# numeric type suffixes to FormatValue display
Evangelink 6aad990
Improve assertion messages: drop parens, specific counts, collection …
Evangelink 1332f35
Drop parentheses from null type display: (null) -> null
Evangelink c6efa3e
Improve InstanceOfType messages: embed type in sentence, combine valu…
Evangelink d8e4572
Add equality hint to AreSame and show hash in AreNotSame
Evangelink 7065af5
Move user message before explanation, drop 'User message:' prefix
Evangelink 25e7447
Replace wildcard patterns with precise expected messages in IsInRange…
Evangelink 370e8ac
Unify assertion failure messages with structured format
Evangelink fa32b9a
Merge branch 'main' into dev/amauryleve/rework-assert
Evangelink a7c777a
Address code review findings
Evangelink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
240 changes: 96 additions & 144 deletions
240
src/TestFramework/TestFramework/Assertions/Assert.AreEqual.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.