You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Data source or fixture: UtilitiesCS.Test/ResourceTests.cs
Steps to Reproduce
Open UtilitiesCS.Test/ResourceTests.cs.
Locate [TestMethod] TestMethod1.
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).
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.
Summary
A live
System.Windows.Forms.Formis constructed inside a unit test inUtilitiesCS.Test,violating the "never construct live forms in unit tests" policy that issue #491 established a
structural MSTest guard for in the sibling
QuickFiler.Testassembly.UtilitiesCS.Testhas noequivalent 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
vstest.console.exe UtilitiesCS.Test\bin\Debug\UtilitiesCS.Test.dll /EnableCodeCoverage /InIsolationUtilitiesCS.Test/ResourceTests.csSteps to Reproduce
UtilitiesCS.Test/ResourceTests.cs.[TestMethod] TestMethod1.Form1 frm = new Form1();, whereForm1resolves toUtilitiesCS.Test/Form1.csandUtilitiesCS.Test/Form1.Designer.cs(a distinct type from theQuickFiler.Test.Form1pair removed by issue Bug: quickfiler-test-form1-live-form #491 - this pair lives in a different assembly).UtilitiesCS.Testsuite;TestMethod1constructs a real WinFormsForminstance duringthe run.
Expected Behavior
Per
.claude/rules/general-unit-test.mdand the "no live form" policy already enforced forQuickFiler.Testby issue #491's new guard test(
NoLiveFormInTestAssemblyTests.ExecutingAssembly_ContainsNoFormDerivedType), no unit test shouldconstruct a live
System.Windows.Forms.Form-derived instance, and no unit-test run should be ableto create a visible window on the desktop.
Actual Behavior
ResourceTests.TestMethod1directly instantiatesForm1vianew Form1(). This is a realconstruction, not merely a compiled-but-unused type (the class distinction from #491's Item 1,
where
QuickFiler.Test.Form1was dead code never instantiated by any test).Logs / Screenshots
UtilitiesCS.Test/ResourceTests.cs:20-Form1 frm = new Form1();Impact / Severity
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-foundationand issue #491), and it is a real construction rather thandead 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