Commit 6f8aa53
authored
Upgrade solution to .NET 10.0 and modernize test infrastructure (#278)
* Upgrade solution to .NET 10.0 and modernize test infrastructure
* All projects now target .NET 10.0, with NuGet packages the target .NET 10.0 only.
* Replaced types marked as obsolete in .NET 10.0 (see below)
* Integration tests have been refactored to use WebApplicationFactory instead of TestServer, and test helpers have been modernized.
* Obsolete package references were removed. Service registration and Razor runtime compilation setup were updated to align with .NET 10 best practices.
* Documentation and type references were clarified.
## Obsolete Types Replaced
### 1. **TestServer & WebHostBuilder** (Test Infrastructure)
- **Obsolete:** `Microsoft.AspNetCore.TestHost.TestServer` + `Microsoft.AspNetCore.Hosting.WebHostBuilder`
- **Replaced with:** `Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<TProgram>`
- **Files affected:**
- `League.Tests\TestComponents\UnitTestHelpers.cs` — removed `GetLeagueTestServer()` method
- `League.Tests\IntegrationTests\BasicIntegrationTests.cs` — refactored to use `WebApplicationFactory<League.WebApp.Program>`
### 2. **IActionContextAccessor & ActionContextAccessor** (Dependency Injection)
- **Obsolete:** `Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor`
- **Obsolete:** `Microsoft.AspNetCore.Mvc.Infrastructure.ActionContextAccessor`
- **Replaced with:** Direct `ActionContext` creation from `IHttpContextAccessor`
- **Files affected:**
- `League\LeagueStartup.cs` — removed registration, now inline `ActionContext` factory in `IUrlHelper` scoped service
### 3. **MvcRazorRuntimeCompilationOptions** (View Compilation)
- **Obsolete:** `Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.MvcRazorRuntimeCompilationOptions`
- **Replaced with:** Direct `AddRazorRuntimeCompilation()` without explicit `FileProviders` configuration (auto-discovery)
- **Files affected:**
- `League.Demo\WebAppStartup.cs` — removed `services.Configure<MvcRazorRuntimeCompilationOptions>(...)` block
- Removed unnecessary `using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;` and `using Microsoft.Extensions.FileProviders;`
* Upgrade solution to .NET 10.0 and modernize test infrastructure
* All projects now target .NET 10.0, with NuGet packages the target .NET 10.0 only.
* Replaced types marked as obsolete in .NET 10.0 (see below)
* Integration tests have been refactored to use WebApplicationFactory instead of TestServer, and test helpers have been modernized.
* Obsolete package references were removed. Service registration and Razor runtime compilation setup were updated to align with .NET 10 best practices.
* Documentation and type references were clarified.
## Obsolete Types Replaced
### 1. **TestServer & WebHostBuilder** (Test Infrastructure)
- **Obsolete:** `Microsoft.AspNetCore.TestHost.TestServer` + `Microsoft.AspNetCore.Hosting.WebHostBuilder`
- **Replaced with:** `Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<TProgram>`
- **Files affected:**
- `League.Tests\TestComponents\UnitTestHelpers.cs` — removed `GetLeagueTestServer()` method
- `League.Tests\IntegrationTests\BasicIntegrationTests.cs` — refactored to use `WebApplicationFactory<League.WebApp.Program>`
### 2. **IActionContextAccessor & ActionContextAccessor** (Dependency Injection)
- **Obsolete:** `Microsoft.AspNetCore.Mvc.Infrastructure.IActionContextAccessor`
- **Obsolete:** `Microsoft.AspNetCore.Mvc.Infrastructure.ActionContextAccessor`
- **Replaced with:** Direct `ActionContext` creation from `IHttpContextAccessor`
- **Files affected:**
- `League\LeagueStartup.cs` — removed registration, now inline `ActionContext` factory in `IUrlHelper` scoped service
### 3. **MvcRazorRuntimeCompilationOptions** (View Compilation)
- **Obsolete:** `Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.MvcRazorRuntimeCompilationOptions`
- **Replaced with:** Direct `AddRazorRuntimeCompilation()` without explicit `FileProviders` configuration (auto-discovery)
- **Files affected:**
- `League.Demo\WebAppStartup.cs` — removed `services.Configure<MvcRazorRuntimeCompilationOptions>(...)` block
- Removed unnecessary `using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation;` and `using Microsoft.Extensions.FileProviders;`
* Bump version 9.0.01 parent 95ca0c7 commit 6f8aa53
File tree
20 files changed
+97
-81
lines changed- Axuno.BackgroundTask.Test
- Axuno.BackgroundTask
- Axuno.Tools.Tests
- Axuno.Tools
- Axuno.Web
- League.Demo
- League.Tests
- IntegrationTests
- TestComponents
- League
- TournamentManager
- DAL
- DatabaseGeneric
- DatabaseSpecific
- TournamentManager.Tests
- TournamentManager
20 files changed
+97
-81
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | 43 | | |
53 | 44 | | |
54 | 45 | | |
| |||
0 commit comments