From 46bc677bb3746390305566d570eb58f1d7090758 Mon Sep 17 00:00:00 2001 From: giammin Date: Mon, 20 Apr 2026 11:17:00 +0200 Subject: [PATCH 1/4] upgrade to .NET 10 and migrate solution to slnx format - Target framework: net8.0 -> net10.0 - Microsoft.AspNetCore.DataProtection: 9.0.0 -> 10.0.5 - System.Security.Cryptography.Xml: pinned to 10.0.6 (patches CVEs GHSA-37gx-xxp4-5rgx and GHSA-w3x6-4m5h-cxqf) - Dapper: 2.1.35 -> 2.1.72 - Microsoft.Data.SqlClient: 5.2.2 -> 7.0.0 - Npgsql: 8.0.5 -> 10.0.2 - Test packages updated to latest (FluentAssertions 8.9, Testcontainers 4.11, Respawn 7.0, xunit 2.9.3, etc.) - Fix obsolete Testcontainers builder constructor calls (image moved to ctor parameter) - Add AspNetCore.DataProtection.CustomStorage.slnx (new XML-based solution format) - Add CLAUDE.md Co-Authored-By: Claude Sonnet 4.6 --- AspNetCore.DataProtection.CustomStorage.slnx | 20 ++++++ CLAUDE.md | 69 +++++++++++++++++++ ...ion.CustomStorage.Dapper.PostgreSQL.csproj | 2 +- ...tion.CustomStorage.Dapper.SQLServer.csproj | 2 +- ...DataProtection.CustomStorage.Dapper.csproj | 2 +- ...etCore.DataProtection.CustomStorage.csproj | 2 +- src/Directory.Build.props | 3 +- ....DataProtection.CustomStorage.Tests.csproj | 8 +-- .../PostgreSQL/PostgreSqlContainerFixture.cs | 3 +- .../SQLServer/SqlServerContainerFixture.cs | 3 +- tests/Directory.Build.props | 14 ++-- 11 files changed, 107 insertions(+), 21 deletions(-) create mode 100644 AspNetCore.DataProtection.CustomStorage.slnx create mode 100644 CLAUDE.md diff --git a/AspNetCore.DataProtection.CustomStorage.slnx b/AspNetCore.DataProtection.CustomStorage.slnx new file mode 100644 index 0000000..ebd5732 --- /dev/null +++ b/AspNetCore.DataProtection.CustomStorage.slnx @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..e426b3c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,69 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Commands + +```bash +# Build +dotnet restore +dotnet build -c Release + +# Test (all) +dotnet test --no-build -c Release + +# Test (single project) +dotnet test tests//.csproj + +# Pack (output to ./build/) +dotnet pack -c Release --no-build +``` + +`TreatWarningsAsErrors` is enabled in Release builds. Always build with `-c Release` before considering a session complete. + +## Architecture + +**AspNetCore.DataProtection.CustomStorage** is a layered library for storing ASP.NET Core Data Protection keys in custom backends. + +### Layer Stack + +``` +ASP.NET Core Data Protection (IXmlRepository) + └── StorageWrapper [core: bridges IXmlRepository ↔ IDataProtectionStorage] + └── IDataProtectionStorage [core: GetAll() / Insert()] + └── IDbDataProtectionStorage [Dapper: adds InitializeDb() / GetAllAsync()] + ├── SQLServerDataProtectionRepository + └── PostgreSQLDataProtectionRepository +``` + +### Key Types + +| Type | Project | Role | +|------|---------|------| +| `IDataProtectionStorage` | Core | Storage contract | +| `StorageWrapper` | Core | `IXmlRepository` adapter; resolves `TStorage` from scoped `IServiceProvider` | +| `DataProtectionKey` | Core | `FriendlyName` + `Xml` | +| `DataProtectionKeyEntity` | Dapper | Extends `DataProtectionKey` with `Id` and `InsertDate` | +| `DapperDataProtectionConfig` | Dapper | Configuration record: schema, table, auto-init flag | +| `IDbDataProtectionStorage` | Dapper | Async-capable contract for DB-backed storage | + +### Entry Points + +- **Core:** `IDataProtectionBuilder.PersistKeysToStorage()` — registers `StorageWrapper` as `IConfigureOptions`. +- **Dapper DB providers:** `DapperDataProtectionExtensions.UseDapperDataProtection()` — calls `InitializeDb()` on startup when `DapperDataProtectionConfig.InitializeTable = true`. + +### Database Implementations + +Both SQL Server and PostgreSQL repositories use raw SQL via Dapper. Schema/table names are configurable. SQL Server defaults to `dbo.DataProtectionKeys` with a NONCLUSTERED unique index on `FriendlyName`; PostgreSQL mirrors this structure. + +### Testing + +Tests use **xUnit**, **FluentAssertions**, and **NSubstitute**. Integration tests spin up real database containers via **Testcontainers** — no external database setup needed. **Respawn** resets state between tests; **Bogus** generates test data. + +Core project exposes internals to the test project via `InternalsVisibleTo`. + +### CI/CD + +- `build.yml`: runs on push to `main` and PRs — restore → build (Release) → test. +- `nuget-publish.yml`: publishes to nuget.org on `v*` tags using `NUGET_KEY` secret. +- `github-release.yml`: creates GitHub release on `v*` tags. diff --git a/src/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj b/src/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj index 965a1e6..6747c9a 100644 --- a/src/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj +++ b/src/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj @@ -5,7 +5,7 @@ Support for storing AspNetCore data protection keys using Dapper in PostgreSQL. - + diff --git a/src/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.csproj b/src/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.csproj index 6478b04..b5f5a14 100644 --- a/src/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.csproj +++ b/src/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.csproj @@ -5,7 +5,7 @@ Support for storing AspNetCore data protection keys using Dapper in SQLServer. - + diff --git a/src/AspNetCore.DataProtection.CustomStorage.Dapper/AspNetCore.DataProtection.CustomStorage.Dapper.csproj b/src/AspNetCore.DataProtection.CustomStorage.Dapper/AspNetCore.DataProtection.CustomStorage.Dapper.csproj index f9e97d2..85b8f34 100644 --- a/src/AspNetCore.DataProtection.CustomStorage.Dapper/AspNetCore.DataProtection.CustomStorage.Dapper.csproj +++ b/src/AspNetCore.DataProtection.CustomStorage.Dapper/AspNetCore.DataProtection.CustomStorage.Dapper.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/AspNetCore.DataProtection.CustomStorage/AspNetCore.DataProtection.CustomStorage.csproj b/src/AspNetCore.DataProtection.CustomStorage/AspNetCore.DataProtection.CustomStorage.csproj index 64e6450..42e20ba 100644 --- a/src/AspNetCore.DataProtection.CustomStorage/AspNetCore.DataProtection.CustomStorage.csproj +++ b/src/AspNetCore.DataProtection.CustomStorage/AspNetCore.DataProtection.CustomStorage.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 1fe9aba..d167abd 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -8,7 +8,7 @@ 0.1 - net8.0 + net10.0 latest disable true @@ -41,6 +41,7 @@ + diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj b/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj index b5f49f6..91a4a60 100644 --- a/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj @@ -13,11 +13,9 @@ - - - - - + + + diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs b/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs index a609696..9d045e1 100644 --- a/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs @@ -14,8 +14,7 @@ namespace AspNetCore.DataProtection.CustomStorage.Tests.PostgreSQL; public class PostgreSqlContainerFixture : IAsyncLifetime { - private readonly PostgreSqlContainer _dbContainer = new PostgreSqlBuilder() - .WithImage("postgres:16.4") + private readonly PostgreSqlContainer _dbContainer = new PostgreSqlBuilder("postgres:16.4") .WithWaitStrategy(Wait.ForUnixContainer()) .Build(); diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs b/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs index 927510d..920ef08 100644 --- a/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs @@ -14,8 +14,7 @@ namespace AspNetCore.DataProtection.CustomStorage.Tests.SQLServer; public class SqlServerContainerFixture : IAsyncLifetime { - private readonly MsSqlContainer _dbContainer = new MsSqlBuilder() - .WithImage("mcr.microsoft.com/mssql/server:2022-latest") + private readonly MsSqlContainer _dbContainer = new MsSqlBuilder("mcr.microsoft.com/mssql/server:2022-latest") .WithPassword(Guid.NewGuid().ToString()) .WithExposedPort(1433).WithPortBinding(1433, true) .Build(); diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 8948579..b9a1ab4 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,6 +1,6 @@ - net8.0; + net10.0; latest disable enable @@ -9,12 +9,12 @@ - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive From bfc924651a49239880a4ef5761b556f1363c3a5e Mon Sep 17 00:00:00 2001 From: giammin Date: Mon, 20 Apr 2026 14:40:23 +0200 Subject: [PATCH 2/4] repository cleanup --- .gitignore | 4 ++ AspNetCore.DataProtection.CustomStorage.sln | 75 --------------------- CLAUDE.md | 69 ------------------- 3 files changed, 4 insertions(+), 144 deletions(-) delete mode 100644 AspNetCore.DataProtection.CustomStorage.sln delete mode 100644 CLAUDE.md diff --git a/.gitignore b/.gitignore index 303df77..c6412f1 100644 --- a/.gitignore +++ b/.gitignore @@ -397,3 +397,7 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml .idea + +# agents +.claude/ +CLAUDE.md diff --git a/AspNetCore.DataProtection.CustomStorage.sln b/AspNetCore.DataProtection.CustomStorage.sln deleted file mode 100644 index 6319330..0000000 --- a/AspNetCore.DataProtection.CustomStorage.sln +++ /dev/null @@ -1,75 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.6.33712.159 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{8658EF6B-C5AE-49AC-A7E4-7185005C95D9}" - ProjectSection(SolutionItems) = preProject - src\Directory.Build.props = src\Directory.Build.props - src\Directory.Build.targets = src\Directory.Build.targets - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{54236874-4D1E-4E0E-9333-892919EC293F}" - ProjectSection(SolutionItems) = preProject - LICENSE = LICENSE - NuGet.Config = NuGet.Config - README.md = README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8E67D983-E2B0-4DEF-9EAC-FB87D2E99D1A}" - ProjectSection(SolutionItems) = preProject - tests\Directory.Build.props = tests\Directory.Build.props - tests\Directory.Build.targets = tests\Directory.Build.targets - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.DataProtection.CustomStorage.Tests", "tests\AspNetCore.DataProtection.CustomStorage.Tests\AspNetCore.DataProtection.CustomStorage.Tests.csproj", "{AC39F953-2296-40CC-A2B1-2F604BD86374}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.DataProtection.CustomStorage", "src\AspNetCore.DataProtection.CustomStorage\AspNetCore.DataProtection.CustomStorage.csproj", "{DFE235EF-3772-41AA-9778-9F64412EF313}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.DataProtection.CustomStorage.Dapper", "src\AspNetCore.DataProtection.CustomStorage.Dapper\AspNetCore.DataProtection.CustomStorage.Dapper.csproj", "{E3ACD59F-6850-4F8E-A620-6B82F7E59E0B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer", "src\AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer\AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.csproj", "{1F61C9EF-2996-4DEA-8FDD-BE644EAC2119}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL", "src\AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL\AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj", "{A9E16154-6CA2-44E5-8661-E5663A52F963}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AC39F953-2296-40CC-A2B1-2F604BD86374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC39F953-2296-40CC-A2B1-2F604BD86374}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC39F953-2296-40CC-A2B1-2F604BD86374}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC39F953-2296-40CC-A2B1-2F604BD86374}.Release|Any CPU.Build.0 = Release|Any CPU - {DFE235EF-3772-41AA-9778-9F64412EF313}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DFE235EF-3772-41AA-9778-9F64412EF313}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DFE235EF-3772-41AA-9778-9F64412EF313}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DFE235EF-3772-41AA-9778-9F64412EF313}.Release|Any CPU.Build.0 = Release|Any CPU - {E3ACD59F-6850-4F8E-A620-6B82F7E59E0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E3ACD59F-6850-4F8E-A620-6B82F7E59E0B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E3ACD59F-6850-4F8E-A620-6B82F7E59E0B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E3ACD59F-6850-4F8E-A620-6B82F7E59E0B}.Release|Any CPU.Build.0 = Release|Any CPU - {1F61C9EF-2996-4DEA-8FDD-BE644EAC2119}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F61C9EF-2996-4DEA-8FDD-BE644EAC2119}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F61C9EF-2996-4DEA-8FDD-BE644EAC2119}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F61C9EF-2996-4DEA-8FDD-BE644EAC2119}.Release|Any CPU.Build.0 = Release|Any CPU - {A9E16154-6CA2-44E5-8661-E5663A52F963}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A9E16154-6CA2-44E5-8661-E5663A52F963}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A9E16154-6CA2-44E5-8661-E5663A52F963}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A9E16154-6CA2-44E5-8661-E5663A52F963}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AC39F953-2296-40CC-A2B1-2F604BD86374} = {8E67D983-E2B0-4DEF-9EAC-FB87D2E99D1A} - {DFE235EF-3772-41AA-9778-9F64412EF313} = {8658EF6B-C5AE-49AC-A7E4-7185005C95D9} - {E3ACD59F-6850-4F8E-A620-6B82F7E59E0B} = {8658EF6B-C5AE-49AC-A7E4-7185005C95D9} - {1F61C9EF-2996-4DEA-8FDD-BE644EAC2119} = {8658EF6B-C5AE-49AC-A7E4-7185005C95D9} - {A9E16154-6CA2-44E5-8661-E5663A52F963} = {8658EF6B-C5AE-49AC-A7E4-7185005C95D9} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E3E547D3-0100-4B9B-A3F5-E99222944FFC} - EndGlobalSection -EndGlobal diff --git a/CLAUDE.md b/CLAUDE.md deleted file mode 100644 index e426b3c..0000000 --- a/CLAUDE.md +++ /dev/null @@ -1,69 +0,0 @@ -# CLAUDE.md - -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. - -## Commands - -```bash -# Build -dotnet restore -dotnet build -c Release - -# Test (all) -dotnet test --no-build -c Release - -# Test (single project) -dotnet test tests//.csproj - -# Pack (output to ./build/) -dotnet pack -c Release --no-build -``` - -`TreatWarningsAsErrors` is enabled in Release builds. Always build with `-c Release` before considering a session complete. - -## Architecture - -**AspNetCore.DataProtection.CustomStorage** is a layered library for storing ASP.NET Core Data Protection keys in custom backends. - -### Layer Stack - -``` -ASP.NET Core Data Protection (IXmlRepository) - └── StorageWrapper [core: bridges IXmlRepository ↔ IDataProtectionStorage] - └── IDataProtectionStorage [core: GetAll() / Insert()] - └── IDbDataProtectionStorage [Dapper: adds InitializeDb() / GetAllAsync()] - ├── SQLServerDataProtectionRepository - └── PostgreSQLDataProtectionRepository -``` - -### Key Types - -| Type | Project | Role | -|------|---------|------| -| `IDataProtectionStorage` | Core | Storage contract | -| `StorageWrapper` | Core | `IXmlRepository` adapter; resolves `TStorage` from scoped `IServiceProvider` | -| `DataProtectionKey` | Core | `FriendlyName` + `Xml` | -| `DataProtectionKeyEntity` | Dapper | Extends `DataProtectionKey` with `Id` and `InsertDate` | -| `DapperDataProtectionConfig` | Dapper | Configuration record: schema, table, auto-init flag | -| `IDbDataProtectionStorage` | Dapper | Async-capable contract for DB-backed storage | - -### Entry Points - -- **Core:** `IDataProtectionBuilder.PersistKeysToStorage()` — registers `StorageWrapper` as `IConfigureOptions`. -- **Dapper DB providers:** `DapperDataProtectionExtensions.UseDapperDataProtection()` — calls `InitializeDb()` on startup when `DapperDataProtectionConfig.InitializeTable = true`. - -### Database Implementations - -Both SQL Server and PostgreSQL repositories use raw SQL via Dapper. Schema/table names are configurable. SQL Server defaults to `dbo.DataProtectionKeys` with a NONCLUSTERED unique index on `FriendlyName`; PostgreSQL mirrors this structure. - -### Testing - -Tests use **xUnit**, **FluentAssertions**, and **NSubstitute**. Integration tests spin up real database containers via **Testcontainers** — no external database setup needed. **Respawn** resets state between tests; **Bogus** generates test data. - -Core project exposes internals to the test project via `InternalsVisibleTo`. - -### CI/CD - -- `build.yml`: runs on push to `main` and PRs — restore → build (Release) → test. -- `nuget-publish.yml`: publishes to nuget.org on `v*` tags using `NUGET_KEY` secret. -- `github-release.yml`: creates GitHub release on `v*` tags. From 540acd2fe557b266779d24f8a514af297733cb01 Mon Sep 17 00:00:00 2001 From: giammin Date: Mon, 20 Apr 2026 14:40:39 +0200 Subject: [PATCH 3/4] version number increase --- src/Directory.Build.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index d167abd..63d32ac 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,9 +1,9 @@ - 1.0 - 1.0 - 1.0 - 1.0 + 1.1 + 1.1 + 1.1 + 1.1 0.1 From 56f0f4705f925c1d6013fbf14b3795d95437b57a Mon Sep 17 00:00:00 2001 From: giammin Date: Mon, 20 Apr 2026 14:52:26 +0200 Subject: [PATCH 4/4] xunit.v3 --- ...aProtection.CustomStorage.Dapper.PostgreSQL.csproj | 8 -------- .../Class1.cs | 6 ------ ...ection.CustomStorage.Dapper.SQLServer.Tests.csproj | 6 ------ .../Class1.cs | 6 ------ ...e.DataProtection.CustomStorage.Dapper.Tests.csproj | 9 --------- ...pNetCore.DataProtection.CustomStorage.Tests.csproj | 6 ++++++ .../PostgreSQL/PostgreSqlContainerFixture.cs | 4 ++-- .../SQLServer/SqlServerContainerFixture.cs | 9 ++++++--- .../xunit.runner.json | 3 +++ tests/Directory.Build.props | 11 ++++++++++- 10 files changed, 27 insertions(+), 41 deletions(-) delete mode 100644 tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj delete mode 100644 tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/Class1.cs delete mode 100644 tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests.csproj delete mode 100644 tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/Class1.cs delete mode 100644 tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests.csproj create mode 100644 tests/AspNetCore.DataProtection.CustomStorage.Tests/xunit.runner.json diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj b/tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj deleted file mode 100644 index 017c231..0000000 --- a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/Class1.cs b/tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/Class1.cs deleted file mode 100644 index af2abfd..0000000 --- a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL/Class1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AspNetCore.DataProtection.CustomStorage.Dapper.PostgreSQL; - -public class Class1 -{ - -} diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests.csproj b/tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests.csproj deleted file mode 100644 index 09aa3fa..0000000 --- a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests.csproj +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/Class1.cs b/tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/Class1.cs deleted file mode 100644 index b7f31ad..0000000 --- a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests/Class1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace AspNetCore.DataProtection.CustomStorage.Dapper.SQLServer.Tests; - -public class Class1 -{ - -} diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests.csproj b/tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests.csproj deleted file mode 100644 index fb9238e..0000000 --- a/tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests/AspNetCore.DataProtection.CustomStorage.Dapper.Tests.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj b/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj index 91a4a60..38fff92 100644 --- a/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/AspNetCore.DataProtection.CustomStorage.Tests.csproj @@ -11,6 +11,12 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs b/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs index 9d045e1..7a43670 100644 --- a/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/PostgreSQL/PostgreSqlContainerFixture.cs @@ -33,7 +33,7 @@ public PostgreSqlContainerFixture() }); } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { await _dbContainer.StartAsync(); @@ -74,7 +74,7 @@ public async Task ResetDatabaseAsync() await _respawner.ResetAsync(dbConnection); } - public async Task DisposeAsync() + public async ValueTask DisposeAsync() { await NpgsqlDataSource.DisposeAsync(); await _dbContainer.StopAsync(); diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs b/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs index 920ef08..58e4455 100644 --- a/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/SQLServer/SqlServerContainerFixture.cs @@ -34,7 +34,7 @@ public SqlServerContainerFixture() }); } - public async Task InitializeAsync() + public async ValueTask InitializeAsync() { await _dbContainer.StartAsync(); @@ -45,7 +45,10 @@ public async Task InitializeAsync() InitialCatalog = initialCatalog, }; - SqlConnectionFactory = new SqlConnectionFactory(connectionStringBuilder.ConnectionString); + SqlConnectionFactory = new SqlConnectionFactory(connectionStringBuilder.ConnectionString + //quick hack for just my configuration (docker on wsl2) + .Replace("localhost", "127.0.0.1") + ); SeedDatabase(); await using var dbConnection = SqlConnectionFactory.CreateConnection(); @@ -72,7 +75,7 @@ public async Task ResetDatabaseAsync() await _respawner.ResetAsync(dbConnection); } - public async Task DisposeAsync() + public async ValueTask DisposeAsync() { await _dbContainer.StopAsync(); await _dbContainer.DisposeAsync(); diff --git a/tests/AspNetCore.DataProtection.CustomStorage.Tests/xunit.runner.json b/tests/AspNetCore.DataProtection.CustomStorage.Tests/xunit.runner.json new file mode 100644 index 0000000..f78bc2f --- /dev/null +++ b/tests/AspNetCore.DataProtection.CustomStorage.Tests/xunit.runner.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json" +} \ No newline at end of file diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index b9a1ab4..d1a252f 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,4 +1,13 @@ + + Exe + true + true + true + + + + net10.0; latest @@ -13,7 +22,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive