Apply structured assertion messages (RFC 012) to AreEqual / AreNotEqual (delta overloads)#8336
Merged
Merged
Conversation
…al (delta overloads) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates numeric delta Assert.AreEqual / Assert.AreNotEqual failures to structured assertion messages and updates resources/tests around assertion output. It also includes broader string assertion resource/test updates and localized XLF regeneration.
Changes:
- Adds structured evidence/call-site rendering for numeric delta assertion failures.
- Updates interpolated-string handler paths for delta overloads.
- Updates
FrameworkMessagesresources, localized XLF files, and unit-test expectations.
Show a summary per file
| File | Description |
|---|---|
src/TestFramework/TestFramework/Assertions/Assert.AreEqual.Numerics.cs |
Implements structured messages for numeric delta failures. |
src/TestFramework/TestFramework/Assertions/Assert.AreEqual.InterpolatedStringHandlers.cs |
Routes delta interpolated-string handlers through structured failure helpers. |
src/TestFramework/TestFramework/Resources/FrameworkMessages.resx |
Adds/updates assertion summary and string-difference resources. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.cs.xlf |
Updates Czech localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.de.xlf |
Updates German localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.es.xlf |
Updates Spanish localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.fr.xlf |
Updates French localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.it.xlf |
Updates Italian localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ja.xlf |
Updates Japanese localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ko.xlf |
Updates Korean localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pl.xlf |
Updates Polish localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.pt-BR.xlf |
Updates Portuguese localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.ru.xlf |
Updates Russian localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.tr.xlf |
Updates Turkish localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hans.xlf |
Updates Simplified Chinese localized resource entries. |
src/TestFramework/TestFramework/Resources/xlf/FrameworkMessages.zh-Hant.xlf |
Updates Traditional Chinese localized resource entries. |
test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqualTests.cs |
Updates assertion-message expectations and delta structured-message coverage. |
Copilot's findings
- Files reviewed: 17/17 changed files
- Comments generated: 16
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Contributor
…s, regenerate XLFs, drop dead helpers - Removed AreNotUnorderedEquivalentFailedSummary, AreUnorderedEquivalentDifferenceSummary, and AreUnorderedEquivalentFailedSummary from FrameworkMessages.resx; they were not referenced by any code in this PR. - Ran UpdateXlf to drop the stale AreEqualDeltaFailMsg / AreNotEqualDeltaFailMsg entries from all localized XLFs (the resx renamed these to *FailedSummary). - Removed the now-unused private helpers BuildUserMessageForExpectedExpressionAndActualExpression / BuildUserMessageForNotExpectedExpressionAndActualExpression / BuildUserMessageForTwoExpressions in Assert.cs (the delta migration removed their only callers; IDE0051 was failing the build). - Reshaped CreateDeltaAreEqualFailureMessage / CreateDeltaAreNotEqualFailureMessage in AssertTests.AreEqualTests.cs to use collection expressions (IDE0300). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…-numerics-areequal-delta
Picks up new AssertThatFailedToEvaluate trans-unit from #8307 across all locales. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Assert.AreEqual/Assert.AreNotEqualoverload failures (float/double/decimal/long) to RFC 012 structured assertion messages.Touched files (behavioral vs. supporting)
Behavioral scope (limited to numeric delta overloads):
src/TestFramework/TestFramework/Assertions/Assert.AreEqual.Numerics.csSupporting / mechanical changes (no behavioral change to other APIs):
src/TestFramework/TestFramework/Assertions/Assert.cs— helpers reused by the new structured delta path.src/TestFramework/TestFramework/Resources/FrameworkMessages.resx+xlf/*.xlf— new delta structured-summary resources.test/UnitTests/TestFramework.UnitTests/Assertions/AssertTests.AreEqual*.cs— updated expectations.Failure messages now use
StructuredAssertionMessage,EvidenceBlock,AssertionValueRenderer, and call-site expressions with a<delta>placeholder, matching RFC 012. String/collection/Assert.ThatAPIs remain out of scope for this PR.Validation
dotnet clean src\TestFramework\TestFramework\TestFramework.csproj -c Release -nologo -v:minimaldotnet build src\TestFramework\TestFramework\TestFramework.csproj -c Release -nologo -v:minimaldotnet build test\UnitTests\TestFramework.UnitTests\TestFramework.UnitTests.csproj -c Release -f net9.0 -p:GenerateBuildInfo=false -nologo -v:minimal(blocked by unrelated pre-existingPlatformVersiongeneration failure insrc/Platform/Microsoft.Testing.Platform/Hosts/ServerTestHost.cs)Reference: RFC 012 structured assertion messages.