Skip to content

Bug: utilitiescs-test-form1-live-form #586

Description

@drmoisan
  • Work Mode: minor-audit

Summary

A live System.Windows.Forms.Form is constructed inside a unit test in UtilitiesCS.Test,
violating the "never construct live forms in unit tests" policy that issue #491 established a
structural MSTest guard for in the sibling QuickFiler.Test assembly. UtilitiesCS.Test has no
equivalent guard, and this construction is real (not merely a declared-but-unused type), so it is a
higher-severity instance of the same defect class than the dead code #491 removed.

Environment

  • OS/version: Windows (repo CI target)
  • Repo: TaskMaster (drmoisan/TaskMaster)
  • Command/flags used: vstest.console.exe UtilitiesCS.Test\bin\Debug\UtilitiesCS.Test.dll /EnableCodeCoverage /InIsolation
  • Data source or fixture: UtilitiesCS.Test/ResourceTests.cs

Steps to Reproduce

  1. Open UtilitiesCS.Test/ResourceTests.cs.
  2. Locate [TestMethod] TestMethod1.
  3. Observe line 20: Form1 frm = new Form1();, where Form1 resolves to
    UtilitiesCS.Test/Form1.cs and UtilitiesCS.Test/Form1.Designer.cs (a distinct type from the
    QuickFiler.Test.Form1 pair removed by issue Bug: quickfiler-test-form1-live-form #491 - this pair lives in a different assembly).
  4. Run the UtilitiesCS.Test suite; TestMethod1 constructs a real WinForms Form instance during
    the run.

Expected Behavior

Per .claude/rules/general-unit-test.md and the "no live form" policy already enforced for
QuickFiler.Test by issue #491's new guard test
(NoLiveFormInTestAssemblyTests.ExecutingAssembly_ContainsNoFormDerivedType), no unit test should
construct a live System.Windows.Forms.Form-derived instance, and no unit-test run should be able
to create a visible window on the desktop.

Actual Behavior

ResourceTests.TestMethod1 directly instantiates Form1 via new Form1(). This is a real
construction, not merely a compiled-but-unused type (the class distinction from #491's Item 1,
where QuickFiler.Test.Form1 was dead code never instantiated by any test).

Logs / Screenshots

  • Attached minimal logs or screenshot
  • Snippet: UtilitiesCS.Test/ResourceTests.cs:20 - Form1 frm = new Form1();

Impact / Severity

  • Blocker
  • Medium
  • Low

Medium: no evidence of CI instability caused by this today, but it is a live violation of the
unit-test policy this repo is actively hardening (see epic
quickfiler-suite-determinism-foundation and issue #491), and it is a real construction rather than
dead code, making it a stronger violation than the one #491 fixed.

Source

From: docs/features/potential/2026-08-22-utilitiescs-test-form1-live-form.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions