Skip to content

refactor(tests): tighten ExceptionHandlerSetup.Collector to private#12

Merged
ANcpLua merged 1 commit into
mainfrom
refactor/exception-handler-private-collector
May 12, 2026
Merged

refactor(tests): tighten ExceptionHandlerSetup.Collector to private#12
ANcpLua merged 1 commit into
mainfrom
refactor/exception-handler-private-collector

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 12, 2026

Summary

ExceptionHandlerSetup.Collector was public but nothing outside the class needs it — the four _setup.Logger.Collector.GetSnapshot() call sites in ExceptionHandlerTests reach the collector via FakeLogger<T>'s own property, not the setup's redundant exposure. Marking it private keeps the test fixture's surface area honest.

Test plan

  • Confirmed all four usages go through _setup.Logger.Collector (i.e., FakeLogger<T>.Collector), not _setup.Collector
  • CI Build & Test (backend) green (no behavioural change, accessibility only)

Nothing outside ExceptionHandlerSetup needs the FakeLogCollector directly -
the four `_setup.Logger.Collector.GetSnapshot()` call sites reach it via
FakeLogger<T>'s own property, not the setup's redundant exposure. Marking
it private keeps the test fixture's surface area honest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 12, 2026 13:29
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • PaperlessREST.Tests/Unit/ExceptionHandlerTests.cs is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 943234fc-f1a0-49b2-b55f-3f22f0968a06

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

@ANcpLua ANcpLua merged commit 394fb01 into main May 12, 2026
3 checks passed
@ANcpLua ANcpLua deleted the refactor/exception-handler-private-collector branch May 12, 2026 13:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Narrows the test fixture API surface by making ExceptionHandlerSetup.Collector private, since the tests already access log snapshots via FakeLogger<T>.Collector rather than through the setup object.

Changes:

  • Changed ExceptionHandlerSetup.Collector from public to private in the test fixture.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ANcpLua added a commit that referenced this pull request May 12, 2026
Sister to #12 ($ExceptionHandlerSetup.Collector). The only consumer is
DisposeAsync inside the same private sealed class, so public access was
unnecessary surface.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants