Skip to content

Remove EqualTo alias documentation#6396

Merged
thomhurst merged 1 commit into
mainfrom
agent/fix-equalto-alias-docs
Jul 12, 2026
Merged

Remove EqualTo alias documentation#6396
thomhurst merged 1 commit into
mainfrom
agent/fix-equalto-alias-docs

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • remove the standalone EqualTo alias section from equality documentation
  • retain IsEqualTo as the natural documented assertion syntax

Root cause

The alias section described EqualTo, but its count-chaining example correctly used Count().IsEqualTo(...). Replacing that call with EqualTo(...) would be invalid because CollectionCountSource only exposes IsEqualTo(int).

Impact

Users no longer see a confusing alias section whose example cannot naturally demonstrate the alias.

Validation

  • yarn build from docs
  • git diff --check

Closes #6360

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@thomhurst
thomhurst merged commit 097d3ad into main Jul 12, 2026
15 checks passed
@thomhurst
thomhurst deleted the agent/fix-equalto-alias-docs branch July 12, 2026 13:22

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Verified the claim in the PR description against the actual assertion library source, since it's the kind of thing that's easy to get backwards in docs:

  • EqualTo(...) is a generic extension method on IAssertionSource<TValue> (TUnit.Assertions/Extensions/AssertionExtensions.cs:53).
  • .Count() on a collection returns CollectionCountSource<TCollection, TItem> (TUnit.Assertions/Conditions/CollectionCountSource.cs:11), which is a standalone class that does not implement IAssertionSource<int> — it only exposes its own IsEqualTo/IsNotEqualTo/IsGreaterThan/etc. members directly.

So the removed example (Count().EqualTo(3)) genuinely would not compile — the PR's stated root cause is correct, not just plausible-sounding. Good catch.

Also checked:

  • No other doc page links to the #equalto-alias anchor or references Using_EqualTo_Alias, so nothing is left dangling by the removal.
  • IsEqualTo/IsNotEqualTo remain documented directly above the removed section, so basic equality coverage is unaffected.
  • The generic scalar EqualTo alias (which is valid on non-collection sources) isn't otherwise documented elsewhere, but that's out of scope for this PR — it's a deletion of an incorrect example, not a claim that the alias doesn't exist anywhere.

No architectural or design concerns — this is a minimal, correctly-scoped documentation fix with no code changes. Nothing to change here.

This was referenced Jul 13, 2026
This was referenced Jul 15, 2026
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.

[Bug]: The description of EqualTo uses IsEqualTo.

1 participant