Add -f/--framework support to TUnit template with .NET Framework handling#6262
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 21 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
ReviewScaffolding logic (computed 1.
|
Code review (follow-up)Re-reviewed after the latest commits. Both issues from my previous review are now resolved:
No new issues introduced by these changes; snapshots were regenerated and committed correctly per the repo's snapshot-testing rule. The one remaining minor note from before — the Nothing further blocking from my side. (Note: this PR is still marked as a draft.) |
8875a1b to
b596128
Compare
Code review (follow-up #2)Confirmed both previously-flagged issues are resolved and stayed resolved in the current head:
One small new nit (non-blocking)
using System.Diagnostics.CodeAnalysis;
#if (IsNetFramework)
[assembly: TestProject.Polyfills.ExcludeFromCodeCoverage]
#else
[assembly: ExcludeFromCodeCoverage]
#endifThe Still open from earlier (minor, unchanged)The No new correctness or architectural issues found. The conditional-generation approach (computed |
The TUnit template lacked
-f/--frameworksupport, making it impossible to scaffold projects targeting specific frameworks — particularly .NET Framework, which requires additional project configuration (polyfills, warning suppression, lang version).Changes
template.json— Addedframeworkchoice parameter (net8.0–net10.0, net462–net481) with computedIsNetFrameworksymbol and conditional source exclusion for thePolyfills/directoryTestProject.csproj— Conditional .NET Framework block:LangVersion=preview,EnableTUnitPolyfills=false,NoWarnfor CS0592/CS0436, andPolyfillpackage referencePolyfills/ExcludeFromCodeCoverageAttribute.cs— Compatibility shim only included for .NET Framework targetsInstantiationTestWithNetFrameworkandOptionsWithFramework()helper; accepted snapshotUsage