feat: improve test output for dictionary ContainsKey#835
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves test output consistency by adding "Expected" values to error messages across string and collection assertions. The main focus is making dictionary ContainsKey error messages clearer by replacing verbose dictionary dumps with concise expected key displays, and standardizing all string comparison error messages to show both actual and expected values.
Key Changes:
- Replaced verbose dictionary context with expected key display in
ContainsKeyassertions - Added expected value output to all string comparison error messages
- Updated test expectations to reflect the new error message format
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/aweXpect/That/Collections/ThatDictionary.ContainsKey.cs | Conditional collection context based on outcome |
| Source/aweXpect/That/Collections/ThatReadOnlyDictionary.ContainsKey.cs | Conditional collection context based on outcome |
| Source/aweXpect/That/Strings/ThatString.IsEqualTo.cs | Added expected value to error context |
| Tests/aweXpect.Tests/Collections/ThatDictionary.ContainsKey.Tests.cs | Updated test expectations to show expected key instead of dictionary |
| Tests/aweXpect.Tests/Collections/ThatReadOnlyDictionary.ContainsKey.Tests.cs | Updated test expectations to show expected key instead of dictionary |
| Tests/aweXpect.Tests/Collections/ThatEnumerable.All.ComplyWith.Tests.cs | Added System.Linq import |
| Tests/aweXpect.Tests/Strings/ThatString.StartsWith.Tests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsNotEqualTo.Tests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsNotEqualTo.AsWildcardTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsNotEqualTo.AsRegexTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsEqualTo.Tests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsEqualTo.AsWildcardTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsEqualTo.AsSuffixTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsEqualTo.AsRegexTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.IsEqualTo.AsPrefixTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.EndsWith.Tests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.DoesNotStartWith.Tests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Strings/ThatString.DoesNotEndWith.Tests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/ExpectTests.cs | Added expected values to multi-assertion test expectations |
| Tests/aweXpect.Tests/Delegates/ThatDelegate.ThrowsException.WhichTests.cs | Added expected value to error message expectations |
| Tests/aweXpect.Tests/Delegates/ThatDelegate.Throws.WhichTests.cs | Added expected value to error message expectations |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nsKey.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
🚀 Benchmark ResultsDetails
|
Test Results 14 files - 27 14 suites - 27 4m 56s ⏱️ + 1m 5s Results for commit 2e60b1a. ± Comparison against base commit 3125a53. This pull request removes 1580 and adds 1554 tests. Note that renamed tests count towards both. |
…y `ContainsKey` (#835) by Valentin Breuß
…y `ContainsKey` (#835) by Valentin Breuß
This PR improves test output consistency by adding "Expected" values to error messages across string and collection assertions. The main focus is making dictionary
ContainsKeyerror messages clearer by replacing verbose dictionary dumps with concise expected key displays, and standardizing all string comparison error messages to show both actual and expected values.Key Changes:
ContainsKeyassertions