ConsoleAssert.GetMessageText has its own inline char-by-char diff that duplicates WildcardMatchAnalyzer.FindMismatchPosition
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- testing-qa
Research direction
Start by reading ConsoleAssert.cs, focusing on GetMessageText and its non-wildcard mismatch loop, then compare it with WildcardMatchAnalyzer.FindMismatchPosition. Confirm how both paths report the first differing character and consolidate the duplicated logic without changing the messages. The work is done when the shared behavior is covered by the existing test suite.
Written by the indexing model from the issue text.
Description
Problem
\GetMessageText\ in \ConsoleAssert.cs\ contains an inline loop that finds the first character difference between two strings:
\\csharp
// existing loop in GetMessageText
for (int i = 0; i < Math.Min(expected.Length, actual.Length); i++)
{
if (expected[i] != actual[i]) { ... }
}
\\
PR #104 added \WildcardMatchAnalyzer.FindMismatchPosition\ which does exactly the same thing.
Impact
This is a minor DRY issue in pre-existing code — no functional bug. The inline loop is used for the non-wildcard mismatch message while \FindMismatchPosition\ is used for the wildcard branch. Both compute the first differing character index.
Suggestion
Extract a shared \FindFirstMismatchIndex(string expected, string actual)\ helper (or delegate the \GetMessageText\ call to \WildcardMatchAnalyzer.FindMismatchPosition) so the logic lives in one place.
This was identified during the PR #104 review but left out because the inline loop is pre-existing code unrelated to the wildcard feature.
- Dominant language
- C#
- Stars
- 1
- Forks
- 0
- Avg merge
- 2m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IntelliTect/TestTools.Console
-
IntelliTect/TestTools.Console#69 · 1 reaction · 2 assignees ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
All issues in IntelliTect/TestTools.Console
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·