Skip to content

fix: make TestUtilities a proper xUnit test-discovery target#96

Merged
s205109 merged 2 commits intomainfrom
fix/testutilities-xunit-runner
Apr 27, 2026
Merged

fix: make TestUtilities a proper xUnit test-discovery target#96
s205109 merged 2 commits intomainfrom
fix/testutilities-xunit-runner

Conversation

@s205109
Copy link
Copy Markdown
Owner

@s205109 s205109 commented Apr 27, 2026

VSCode C# Dev Kit treats any assembly under tests/ with xUnit references as a test discovery target. Without Microsoft.NET.Test.Sdk + xunit.runner.visualstudio, testhost fails to resolve transitive packages (e.g. Ardalis.Result) and discovery aborts repeatedly.

Add the test SDK + runner and switch back to the full xunit package. Drop IsTestProject=false (no longer accurate).

Summary

Brief description of changes.

Checklist

  • Tests pass (dotnet test)
  • Build succeeds (dotnet build)
  • No new warnings introduced
  • Breaking changes documented (if any)

VSCode C# Dev Kit treats any assembly under tests/ with xUnit references
as a test discovery target. Without Microsoft.NET.Test.Sdk +
xunit.runner.visualstudio, testhost fails to resolve transitive packages
(e.g. Ardalis.Result) and discovery aborts repeatedly.

Add the test SDK + runner and switch back to the full xunit package.
Drop IsTestProject=false (no longer accurate).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@s205109 s205109 requested a review from Copilot April 27, 2026 21:16
Copy link
Copy Markdown
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 updates the AHKFlowApp.TestUtilities project to behave like a proper xUnit test-discovery target (for VS Code C# Dev Kit) by adding the .NET test SDK and Visual Studio test runner packages and removing the IsTestProject=false override.

Changes:

  • Remove IsTestProject=false from tests/AHKFlowApp.TestUtilities.
  • Add Microsoft.NET.Test.Sdk and xunit.runner.visualstudio package references to support discovery/execution in VS Code.

Comment thread tests/AHKFlowApp.TestUtilities/AHKFlowApp.TestUtilities.csproj Outdated
Comment thread tests/AHKFlowApp.TestUtilities/AHKFlowApp.TestUtilities.csproj
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

Test Results

2 tests   2 ✅  5s ⏱️
1 suites  0 💤
1 files    0 ❌

Results for commit 2b91072.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

Summary

Summary
Generated on: 04/27/2026 - 21:30:26
Coverage date: 04/27/2026 - 21:28:46 - 04/27/2026 - 21:30:16
Parser: MultiReport (11x Cobertura)
Assemblies: 6
Classes: 66
Files: 56
Line coverage: 74.4% (477 of 641)
Covered lines: 477
Uncovered lines: 164
Coverable lines: 641
Total lines: 2230
Branch coverage: 48.2% (69 of 143)
Covered branches: 69
Total branches: 143
Method coverage: Feature is only available for sponsors
Tag: 122_25020466679

Coverage

AHKFlowApp.API - 61.4%
Name Line Branch
AHKFlowApp.API 61.4% 51%
AHKFlowApp.API.Auth.HttpContextCurrentUser 100% 46.1%
AHKFlowApp.API.Auth.TestAuthenticationHandler 100%
AHKFlowApp.API.Controllers.DevController 100%
AHKFlowApp.API.Controllers.HealthController 100%
AHKFlowApp.API.Controllers.HotstringsController 100%
AHKFlowApp.API.Controllers.VersionController 100%
AHKFlowApp.API.Controllers.WhoAmIController 100%
AHKFlowApp.API.DevDockerSqlServer 0% 0%
AHKFlowApp.API.Extensions.ApiExtensions 100%
AHKFlowApp.API.Extensions.ProblemDetailsResultExtensions 100% 100%
AHKFlowApp.API.Middleware.GlobalExceptionMiddleware 100%
AHKFlowApp.API.Models.HealthResponse 100%
AHKFlowApp.API.OpenApi.Examples.CreateHotstringDtoExample 0%
AHKFlowApp.API.OpenApi.Examples.HotstringDtoExample 0%
AHKFlowApp.API.OpenApi.Examples.PagedHotstringsExample 0%
AHKFlowApp.API.OpenApi.Examples.UpdateHotstringDtoExample 0%
AHKFlowApp.Application - 98.1%
Name Line Branch
AHKFlowApp.Application 98.1% 47%
AHKFlowApp.Application.Behaviors.ValidationBehavior`2 100%
AHKFlowApp.Application.Commands.Dev.SeedHotstringsCommandHandler 100%
AHKFlowApp.Application.Commands.Hotstrings.CreateHotstringCommandHandler 66.6% 0%
AHKFlowApp.Application.Commands.Hotstrings.CreateHotstringCommandValidator 100%
AHKFlowApp.Application.Commands.Hotstrings.DeleteHotstringCommandHandler 100%
AHKFlowApp.Application.Commands.Hotstrings.UpdateHotstringCommandHandler 100% 58.3%
AHKFlowApp.Application.Commands.Hotstrings.UpdateHotstringCommandValidator 100%
AHKFlowApp.Application.DependencyInjection 100%
AHKFlowApp.Application.DTOs.CreateHotstringDto 100%
AHKFlowApp.Application.DTOs.HotstringDto 100%
AHKFlowApp.Application.DTOs.PagedList`1 100% 50%
AHKFlowApp.Application.DTOs.UpdateHotstringDto 100%
AHKFlowApp.Application.Mapping.HotstringMappings 100%
AHKFlowApp.Application.Queries.Hotstrings.GetHotstringQueryHandler 100%
AHKFlowApp.Application.Queries.Hotstrings.ListHotstringsQuery 100%
AHKFlowApp.Application.Queries.Hotstrings.ListHotstringsQueryHandler 100%
AHKFlowApp.Application.Queries.Hotstrings.ListHotstringsQueryValidator 100%
AHKFlowApp.Application.Validation.HotstringRules 100% 100%
AHKFlowApp.Domain - 100%
Name Line Branch
AHKFlowApp.Domain 100% ****
AHKFlowApp.Domain.Entities.Hotstring 100%
AHKFlowApp.Infrastructure - 100%
Name Line Branch
AHKFlowApp.Infrastructure 100% 50%
AHKFlowApp.Infrastructure.DependencyInjection 100%
AHKFlowApp.Infrastructure.Persistence.AppDbContext 100%
AHKFlowApp.Infrastructure.Persistence.Configurations.HotstringConfiguration 100%
AHKFlowApp.Infrastructure.Persistence.Configurations.TestMessageConfigurati
on
100%
AHKFlowApp.Infrastructure.Services.VersionService 100% 50%
AHKFlowApp.TestUtilities - 57.5%
Name Line Branch
AHKFlowApp.TestUtilities 57.5% 100%
AHKFlowApp.TestUtilities.Auth.TestAuthHandler 100% 100%
AHKFlowApp.TestUtilities.Auth.TestUserBuilder 77.7%
AHKFlowApp.TestUtilities.Builders.HealthResponseBuilder 0%
AHKFlowApp.TestUtilities.Builders.HotstringBuilder 0%
AHKFlowApp.TestUtilities.Fixtures.CustomWebApplicationFactory 100% 100%
AHKFlowApp.TestUtilities.Fixtures.SqlContainerFixture 100%
AutoGeneratedProgram 0%
AHKFlowApp.UI.Blazor - 76%
Name Line Branch
AHKFlowApp.UI.Blazor 76% 36.9%
AHKFlowApp.UI.Blazor.Auth.ApiAuthorizationMessageHandler 0%
AHKFlowApp.UI.Blazor.Auth.TestAuthenticationProvider 0%
AHKFlowApp.UI.Blazor.DTOs.ApiProblemDetails 100%
AHKFlowApp.UI.Blazor.DTOs.CreateHotstringDto 100%
AHKFlowApp.UI.Blazor.DTOs.HealthResponse 100%
AHKFlowApp.UI.Blazor.DTOs.HotstringDto 100%
AHKFlowApp.UI.Blazor.DTOs.PagedList`1 100%
AHKFlowApp.UI.Blazor.DTOs.UpdateHotstringDto 100%
AHKFlowApp.UI.Blazor.Layout.MainLayout 0%
AHKFlowApp.UI.Blazor.Pages.Health 100% 100%
AHKFlowApp.UI.Blazor.Pages.Hotstrings 90.9%
AHKFlowApp.UI.Blazor.Services.AhkFlowAppApiHttpClient 100%
AHKFlowApp.UI.Blazor.Services.ApiErrorMessageFactory 58.3% 26.6%
AHKFlowApp.UI.Blazor.Services.ApiResult 50%
AHKFlowApp.UI.Blazor.Services.ApiResult`1 100%
AHKFlowApp.UI.Blazor.Services.HotstringsApiClient 60% 41.6%
AHKFlowApp.UI.Blazor.Shared.LoginDisplay 0%
AHKFlowApp.UI.Blazor.Shared.RedirectToLogin 0%
AHKFlowApp.UI.Blazor.Validation.HotstringEditModel 100%

Per-assembly thresholds: Domain line≥85% br≥70% · Application line≥85% br≥45% · Infrastructure line≥70% br≥50% · API line≥57% br≥50% · UI.Blazor line≥65% br≥28%

Matches pattern used in all other test projects; prevents runner from
flowing transitively to projects that reference TestUtilities.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@s205109 s205109 changed the title fix: swap xunit -> xunit.core in TestUtilities fix: make TestUtilities a proper xUnit test-discovery target Apr 27, 2026
@s205109 s205109 merged commit 452a054 into main Apr 27, 2026
3 checks passed
@s205109 s205109 deleted the fix/testutilities-xunit-runner branch April 27, 2026 21:31
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