Summary
UtilitiesCS/EmailIntelligence/EmailParsingSorting/SortEmail.cs is 1,454 lines, nearly three times the 500-line limit. It also mixes sorting logic with direct file-system and WinForms dialog calls that tests cannot reach. #945 added one injected seam for directory creation, and its review reported three residual follow-ups, recorded here together because they share one cause and one file.
Environment
Steps to Reproduce
- Count the lines in
SortEmail.cs: 1,454.
- Read
TrySaveAttachmentAsync. It carries [ExcludeFromCodeCoverage] because of the YesNoToAll.ShowDialog prompt, and its UnauthorizedAccessException branches are untested.
- Search the other
SortEmail helpers for direct System.IO.Directory and System.IO.File calls.
Expected Behavior
- Each file is under 500 lines, with cohesive partial classes or extracted types.
- UI prompts and file-system access sit behind injectable seams, so the coverage exclusion can be removed and the error branches tested.
Actual Behavior
- The file is over the limit.
- The dialog branch forces a coverage exclusion.
- Other helpers may still touch the real file system.
Logs / Screenshots
Impact / Severity
Source
From: docs/features/potential/2026-10-01-sort-email-oversized-with-untestable-io-and-dialog-paths.md
Summary
UtilitiesCS/EmailIntelligence/EmailParsingSorting/SortEmail.csis 1,454 lines, nearly three times the 500-line limit. It also mixes sorting logic with direct file-system and WinForms dialog calls that tests cannot reach. #945 added one injected seam for directory creation, and its review reported three residual follow-ups, recorded here together because they share one cause and one file.Environment
SortEmail.csafter PR for Bug: sort-email-attachment-test-creates-directory-at-repository-root #945Steps to Reproduce
SortEmail.cs: 1,454.TrySaveAttachmentAsync. It carries[ExcludeFromCodeCoverage]because of theYesNoToAll.ShowDialogprompt, and itsUnauthorizedAccessExceptionbranches are untested.SortEmailhelpers for directSystem.IO.DirectoryandSystem.IO.Filecalls.Expected Behavior
Actual Behavior
Logs / Screenshots
Impact / Severity
Source
From: docs/features/potential/2026-10-01-sort-email-oversized-with-untestable-io-and-dialog-paths.md