#85856·roslyn

Evaluate xUnit v3 TestContext for Razor parser test setup

Author: mwiemer-microsoftCreated Sep 30, 2026Updated Oct 1, 2026
LabelsArea-Razor

AI-generated:

InitializeTestFileAttribute in src/Razor/src/Shared/Microsoft.AspNetCore.Razor.Test.Common/Language/Legacy/InitializeTestFileAttribute.cs currently uses BeforeAfterTestAttribute hooks and MethodInfo to set up parser-test state. Evaluate whether xUnit v3's TestContext APIs provide a simpler, more direct way to access the active test context and make this custom attribute unnecessary or easier to maintain.