Skip to content

Refactor: Split Assert.AreEquivalent.Comparer.cs into focused files#8333

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-split-assert-arequivalent-comparer
Draft

Refactor: Split Assert.AreEquivalent.Comparer.cs into focused files#8333
Copilot wants to merge 2 commits into
mainfrom
copilot/refactor-split-assert-arequivalent-comparer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Assert.AreEquivalent.Comparer.cs had grown to 1248 lines with four logically distinct responsibilities bundled together, making navigation and maintenance difficult.

Changes

Splits the file into focused partial class Assert files, moving private helper types to their own homes:

  • Assert.AreEquivalent.Mismatch.cs (161 lines) — EquivalenceMismatch: result DTO with all failure-kind factory methods
  • Assert.AreEquivalent.DictionaryView.cs (188 lines) — DictionaryView (abstract), NonGenericDictionaryView, GenericDictionaryView, GenericDictionaryAccessors, DictionaryLookup
  • Assert.AreEquivalent.MemberAccessor.cs (70 lines) — MemberAccessor, MemberLookup, ReferenceObjectComparer
  • Assert.AreEquivalent.Comparer.cs trimmed to 850 lines — EquivalenceComparer core orchestration only

All types remain private nested classes within partial class Assert. No logic changes, no public API impact.

The trimmed Comparer.cs exceeds the 300-line target because EquivalenceComparer is a single cohesive recursive algorithm that cannot be meaningfully decomposed further without splitting logic across files.

Copilot AI self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 19:25
Copilot AI review requested due to automatic review settings May 18, 2026 19:25
Copilot AI linked an issue May 18, 2026 that may be closed by this pull request
5 tasks
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 18, 2026 19:38
Copilot AI changed the title [WIP] Refactor Assert.AreEquivalent.Comparer.cs into smaller files Refactor: Split Assert.AreEquivalent.Comparer.cs into focused files May 18, 2026
Copilot AI requested a review from Evangelink May 18, 2026 19:38
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.

Refactor: Split Assert.AreEquivalent.Comparer.cs (1248 lines) into focused files

2 participants