Skip to content

feat(AssertionLibrary): Add assertion library choice to templates#1659

Open
DevTKSS wants to merge 13 commits intounoplatform:mainfrom
DevTKSS:feature/add-assertion-library-choice
Open

feat(AssertionLibrary): Add assertion library choice to templates#1659
DevTKSS wants to merge 13 commits intounoplatform:mainfrom
DevTKSS:feature/add-assertion-library-choice

Conversation

@DevTKSS
Copy link
Contributor

@DevTKSS DevTKSS commented Jul 18, 2025

GitHub Issue (If applicable): closes #1607

PR Type

What kind of change does this PR introduce?

  • Feature
  • Enhancement of User-Expirience

What is the current behavior?

Creating a new Project from template, will always include FluentAssertions Package, which is up from v8.0 commercial and paid.
for more information about the reason this should be made available to activly select, see the linked issues.

What is the new behavior?

This PR should enable us users to activly choose IF and WHICH assertion Library we want to use.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Associated with an issue (GitHub or internal)

Other information

Partially about Parent issue of 1607 : #1605
@MartinZikmund @jeromelaban
Its likly, as this is my first time with dotnet templates, that there will be some issues made so would be great to get some help ❤️ I tryed my best to follow the templating wiki of the CLI

Would add an xUnit Testing project option at some later point in a seperate PR to improve it for #1258

This PR needs help on:

  • implementing it to the Visual Studion Wizard
    as there is no schema for the TemplateWizard.json available, I would assume, that uses a internal flow. I added a Property "NestedIn" for the assertionLibrary symbols, but would need someone from the team to implement or update this. Maybe if it is a own schema you are using (and this file is overall used) it would be great if you could add such schema reference in the repository
  • The choice of the assertionLibrary at least for the vsix templates could be made available per Test project, but I am not sure how to do that exactly, but would be nice to have!

Internal Issue (If applicable):

Copilot AI review requested due to automatic review settings July 18, 2025 12:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a new assertion library selection feature for Uno templates, addressing the commercial licensing changes in FluentAssertions v8.0. The change enables users to choose between FluentAssertions, Shouldly, or no assertion library when creating new projects from templates.

  • Adds an assertionLibrary parameter to template configurations with three options: none, Shouldly, and FluentAssertions
  • Refactors existing templates to conditionally include assertion libraries based on user selection
  • Updates global usings and test files to support multiple assertion library choices

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.template.config/template.json Adds assertion library choice parameter and computed symbols
.template.config/dotnetcli.host.json Exposes assertion library parameter to CLI
.template.config/TemplateWizard.json Integrates assertion library selection into Visual Studio wizard
*.csproj Conditionally includes assertion library package references
GlobalUsings.cs Conditionally imports assertion library namespaces
AppInfoTests.cs Implements conditional assertion logic for different libraries
Directory.Build.targets Adds Shouldly version configuration
Uno.Templates.csproj Adds Shouldly version replacement logic

@DevTKSS
Copy link
Contributor Author

DevTKSS commented Nov 28, 2025

Hi @jeromelaban,
just a quick check-in on this PR. It’s been open since July, and together with #1660 it would improve the Unit Test templates by adding Shouldly as an optional (free) assertion library, instead of only providing FluentAssertions (paid/commercial) without an opt-out.

If you have a moment, could you let me know whether this is still on the backlog or if any changes are needed on my side?

Thanks!

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.

[Testing][Assertations] Add Shouldly as optional/alternative Assertation Package

1 participant