fix(configuration-database): resolve ConfigurationDatabase-013,014 — fail-fast on missing key ring, single converter local; ConfigurationDatabase-012 left open (cross-module design decision)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
@@ -10,10 +11,16 @@ namespace ScadaLink.ConfigurationDatabase.Tests;
|
||||
/// Test DbContext that adapts SQL Server-specific features for SQLite:
|
||||
/// - Maps DateTimeOffset to sortable ISO 8601 strings (SQLite has no native DateTimeOffset ORDER BY)
|
||||
/// - Replaces SQL Server RowVersion with a nullable byte[] column (SQLite can't auto-generate rowversion)
|
||||
///
|
||||
/// Constructed with an explicit ephemeral Data Protection provider so secret-bearing
|
||||
/// columns are write-capable in tests. The schema-only no-provider constructor would
|
||||
/// throw on a secret-column write (ConfigurationDatabase-013); passing a provider here
|
||||
/// makes the test fixture's intent explicit at the call site.
|
||||
/// </summary>
|
||||
public class SqliteTestDbContext : ScadaLinkDbContext
|
||||
{
|
||||
public SqliteTestDbContext(DbContextOptions<ScadaLinkDbContext> options) : base(options)
|
||||
public SqliteTestDbContext(DbContextOptions<ScadaLinkDbContext> options)
|
||||
: base(options, new EphemeralDataProtectionProvider())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user