Templates: allow to choose between MSTest, NUnit and xUnit#3777
Templates: allow to choose between MSTest, NUnit and xUnit#3777DamianEdwards merged 8 commits intomicrosoft:mainfrom
Conversation
|
I wasn't able to validate the starter project template as there are many packages that cannot be restored (not from the test project) so I am not sure what I am doing wrong. The call to |
…config/template.json
Co-authored-by: Damian Edwards <damian@damianedwards.com>
|
@Evangelink FYI I'm going to pull down your fork and verify the package changes locally before approving |
|
Templates install from locally built package OK: And they show up VS too: Verifying what @phenning said that when we change template groupid for the xunit template, you end up with duplicate templates for xUnit if you have the template from the workload (old groupid) and template from the package (new groupid) both installed. This shouldn't be a concern in the real-world for customers though as installing the templates from a NuGet package isn't a mainstream scenario and the 8.0 and 8.1 workloads won't be side-by-side either (IIUC). Option for test framework to use on the Starter template shows up in VS OK: And the CLI too: New Starter project with MSTest project works in VS: Works from the CLI too via For NUnit it seems we have a missing But I think we actually want to change to NUnit's new assertion pattern: xUnit option is missing the required |
DamianEdwards
left a comment
There was a problem hiding this comment.
These changes should fix the issues with the NUnit and xUnit options in the Starter template.
|
[like] Phil Henning reacted to your message:
…________________________________
From: Damian Edwards ***@***.***>
Sent: Tuesday, April 23, 2024 11:55:43 PM
To: dotnet/aspire ***@***.***>
Cc: Phil Henning ***@***.***>; Mention ***@***.***>
Subject: Re: [dotnet/aspire] Templates: allow to choose between MSTest, NUnit and xUnit (PR #3777)
Templates install from locally built package OK:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/377ebe89-9881-4e34-881d-306aba8a0981>
And they show up VS too:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/9a96298c-015d-40d4-ae6d-7dbe369feba4>
Verifying what @phenning<https://github.com/phenning> said that when we change template groupid for the xunit template, you end up with duplicate templates for xUnit if you have the template from the workload (old groupid) and template from the package (new groupid) both installed. This shouldn't be a concern in the real-world for customers though as installing the templates from a NuGet package isn't a mainstream scenario and the 8.0 and 8.1 workloads won't be side-by-side either (IIUC).
Option for test framework to use on the Starter template shows up in VS OK:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/8bca207b-d2a3-430e-b228-8a66b5d1260e>
And the CLI too:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/95e203b9-e13c-41a9-a1a4-4238fc0bd534>
New Starter project with MSTest project works in VS:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/7ad08156-66cf-4ae3-a28e-0e822ab261b8>
Works from the CLI too via dotnet test:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/5bf81d33-42a9-4a9a-b39e-8d1cd31dccd8>
For NUnit it seems we have a missing using:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/3dcc6220-d319-4f49-87b1-ff6e8855f00a>
But I think we actually want to change to NUnit's new assertion pattern:
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/f839e4f7-116b-4b08-b57e-a18d6061a06b>
xUnit option is missing the required [Fact] and Assert lines completely (and the PackageReference in the .csproj file):
image.png (view on web)<https://github.com/dotnet/aspire/assets/249088/5e1d2d79-a430-4e42-8754-a035db55ec9d>
—
Reply to this email directly, view it on GitHub<#3777 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AASSFVWNG3TPGWCTSORZXODY63YH7AVCNFSM6AAAAABGLZMSWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTGY3TKMZTGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Co-authored-by: Damian Edwards <damian@damianedwards.com>
Thanks @DamianEdwards! I totally forgot to redo the manual tests after the last few commits... Sorry and glad you tested it. |
|
/backport to release/8.0 |
|
Started backporting to release/8.0: https://github.com/dotnet/aspire/actions/runs/8854449410 |









Fixes #2908
cc @pavelhorak
Microsoft Reviewers: Open in CodeFlow