Skip to content

Add -f/--framework support to TUnit template with .NET Framework handling#6262

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-support-for-framework-option
Draft

Add -f/--framework support to TUnit template with .NET Framework handling#6262
Copilot wants to merge 3 commits into
mainfrom
copilot/add-support-for-framework-option

Conversation

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

The TUnit template lacked -f/--framework support, 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 — Added framework choice parameter (net8.0–net10.0, net462–net481) with computed IsNetFramework symbol and conditional source exclusion for the Polyfills/ directory
  • TestProject.csproj — Conditional .NET Framework block: LangVersion=preview, EnableTUnitPolyfills=false, NoWarn for CS0592/CS0436, and Polyfill package reference
  • Polyfills/ExcludeFromCodeCoverageAttribute.cs — Compatibility shim only included for .NET Framework targets
  • Template tests — Added InstantiationTestWithNetFramework and OptionsWithFramework() helper; accepted snapshot

Usage

dotnet new TUnit -n MyTests -f net8.0    # modern .NET (clean project)
dotnet new TUnit -n MyTests -f net48     # .NET Framework (polyfills + warnings suppressed)
dotnet new TUnit -n MyTests              # defaults to net10.0

@codacy-production

codacy-production Bot commented Jun 16, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 medium

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
BestPractice 1 medium

View in Codacy

🟢 Metrics 21 complexity

Metric Results
Complexity 21

View in Codacy

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.

Copilot AI changed the title [WIP] Add support for -f / --framework with template handling Add -f/--framework support to TUnit template with .NET Framework handling Jun 16, 2026
Copilot AI requested a review from thomhurst June 16, 2026 09:36
Copilot AI temporarily deployed to Pull Requests June 16, 2026 17:24 Inactive
Copilot AI temporarily deployed to Pull Requests June 16, 2026 17:24 Inactive
Copilot AI temporarily deployed to Pull Requests June 16, 2026 17:24 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants