Skip to content

Refactor: coverage-gaps-test-seams #236

Description

@drmoisan
  • Work Mode: full-feature

Problem / Why

TaskMaster has strong test coverage overall, but several QuickFiler elements still
have uncovered logic because their current implementations couple directly to
Outlook COM, WinForms viewers, static queues, and UI control state. The target
elements are:

  • EfcViewerQueue
  • ItemViewerQueue
  • QfcThemeHelper
  • EfcHomeController
  • TlpCellStates

The coverage gap should be closed by adding testable seams or isolating logic
into testable methods. Coverage exemptions are not permitted.

Proposed Behavior

Refactor the target elements so deterministic unit tests can exercise their
decision logic without launching Outlook, dereferencing live COM objects, or
requiring live WinForms windows. Use narrow seams where external boundaries must
remain, and keep default production behavior compatible with existing callers.

Where seam injection is insufficient, move pure logic into focused methods or
small collaborators so minimal code remains untestable.

Acceptance Criteria

  • EfcViewerQueue has deterministic unit coverage for queue creation,
    dequeue behavior, cancellation/disposal boundaries, and any newly
    introduced seam behavior without requiring a live WinForms viewer.
  • ItemViewerQueue has deterministic unit coverage for queue creation,
    dequeue behavior, cancellation/disposal boundaries, and any newly
    introduced seam behavior without requiring a live WinForms viewer.
  • QfcThemeHelper has deterministic unit coverage for theme construction
    and control-group mapping logic without requiring live form instances
    beyond test-controlled controls or adapters.
  • EfcHomeController has deterministic unit coverage for controller
    decision logic by using seams for Outlook COM and viewer construction
    boundaries.
  • TlpCellStates has deterministic unit coverage for constructors,
    conversion behavior, and edge cases for null or empty inputs when
    applicable.
  • Repository coverage remains at or above the configured minimums, and the
    named elements meet the repo policy for changed or newly introduced code.
  • The C# toolchain passes in order: CSharpier, .NET analyzers, nullable
    analysis, and MSTest with code coverage.

Constraints & Risks

  • Preserve existing production behavior for Outlook and QuickFiler workflows.
  • Do not add coverage exemptions or weaken coverage policy.
  • Keep seams narrow and local to COM, WinForms, and static-construction
    boundaries.
  • Avoid broad refactors outside the named coverage targets unless required to
    expose a testable boundary.
  • Unit tests must remain deterministic and must not depend on Outlook, external
    services, mutable machine state, or temporary files.

Test Conditions

  • Queue creation and dequeue behavior with injected factories or providers.
  • Cancellation and disposal behavior around viewer acquisition.
  • Theme group construction with representative buttons and panels.
  • TlpCellStates constructors from both typed snapshot lists and raw
    snapshot lists.
  • EfcHomeController paths that can be covered through injected
    collaborators rather than live COM or live forms.
  • Full MSTest run with code coverage enabled.

Source

From: docs/features/potential/2026-07-04-coverage-gaps-test-seams.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions