Alvecta.Foundation.Infrastructure.EF.Testing 4.1.37

dotnet add package Alvecta.Foundation.Infrastructure.EF.Testing --version 4.1.37
                    
NuGet\Install-Package Alvecta.Foundation.Infrastructure.EF.Testing -Version 4.1.37
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Alvecta.Foundation.Infrastructure.EF.Testing" Version="4.1.37" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alvecta.Foundation.Infrastructure.EF.Testing" Version="4.1.37" />
                    
Directory.Packages.props
<PackageReference Include="Alvecta.Foundation.Infrastructure.EF.Testing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Alvecta.Foundation.Infrastructure.EF.Testing --version 4.1.37
                    
#r "nuget: Alvecta.Foundation.Infrastructure.EF.Testing, 4.1.37"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Alvecta.Foundation.Infrastructure.EF.Testing@4.1.37
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Alvecta.Foundation.Infrastructure.EF.Testing&version=4.1.37
                    
Install as a Cake Addin
#tool nuget:?package=Alvecta.Foundation.Infrastructure.EF.Testing&version=4.1.37
                    
Install as a Cake Tool

Alvecta.Foundation.Infrastructure.EF.Testing

EF Core persistence test harness for solutions that follow the Alvecta read/write DbContext split: a projection-only read context that maps the query schema and owns the migrations, and a write context that maps the domain entities as a relational subset of it.

The package is a library of abstract xunit base classes (not a runnable test project). Each consuming solution adds thin sealed run-host subclasses that supply the context factories.

What it pins

  • SchemaParityTestsBase<TReadDbContext, TWriteDbContext> — the scalar shapes of the two models (table names, columns, store types, nullability — navigations excluded) must match exactly, and the read face keeps its structural guarantees: no tracking, the projection-only materialization interceptor registered, and refusing SaveChangesAsync.
  • MigrationsDriftTestsBase<TDbContext> — the migrations-owning context has no pending model changes relative to its snapshot.
  • ModelShapes — the shape-rendering helper behind the parity assertion, public for solution-specific comparisons.

Usage

public sealed class ConnectorSchemaParityTests
    : SchemaParityTestsBase<ConnectorReadDbContext, ConnectorWriteDbContext>
{
    protected override ConnectorReadDbContext CreateReadDbContext() => TestDbContexts.ConnectorRead();

    protected override ConnectorWriteDbContext CreateWriteDbContext() => TestDbContexts.ConnectorWrite();
}

public sealed class ConnectorMigrationsDriftTests : MigrationsDriftTestsBase<ConnectorReadDbContext>
{
    // Build through the design-time factory the `dotnet ef` tooling uses, so the comparison sees
    // exactly what migration generation would see.
    protected override ConnectorReadDbContext CreateDbContext()
        => new ConnectorDbContextDesignTimeFactory().CreateDbContext([]);
}

Contexts built against a dummy connection string are fine — none of the tests touches the database.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.37 62 7/9/2026
4.0.36 62 7/9/2026
4.0.35 83 7/8/2026
3.0.34 85 7/7/2026
2.5.33 96 7/6/2026
2.5.32 90 7/4/2026
2.4.31 94 7/4/2026
2.3.30 95 7/4/2026
2.2.29 87 7/4/2026
2.1.28 88 7/4/2026
2.1.27 88 7/4/2026