Skip to content

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

<PackageReference Include="FluentAssertions" VersionOverride="$FluentAssertions$" />
<!--#endif-->
<!--#if (useShouldly)-->
<PackageReference Include="Shouldly" VersionOverride="$ShouldlyVersion$" />
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

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

The version placeholder '$ShouldlyVersion$' is inconsistent with the replacement pattern '$Shouldly$' defined in Uno.Templates.csproj line 49. This will prevent proper version substitution during template processing.

Suggested change
<PackageReference Include="Shouldly" VersionOverride="$ShouldlyVersion$" />
<PackageReference Include="Shouldly" VersionOverride="$Shouldly$" />

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 not sure about that, since Uno.Templates.csproj pattern is using Replacement Text with the Version postfix
could somone check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

looking at Directory.Build.targets file the ShouldlyVersion parameter should be correctly but the FluentAssertions parameter might miss that Version postfix

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