XBullet.EasyTesting.EntityFrameworkCore 1.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package XBullet.EasyTesting.EntityFrameworkCore --version 1.0.9
                    
NuGet\Install-Package XBullet.EasyTesting.EntityFrameworkCore -Version 1.0.9
                    
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="XBullet.EasyTesting.EntityFrameworkCore" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XBullet.EasyTesting.EntityFrameworkCore" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="XBullet.EasyTesting.EntityFrameworkCore" />
                    
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 XBullet.EasyTesting.EntityFrameworkCore --version 1.0.9
                    
#r "nuget: XBullet.EasyTesting.EntityFrameworkCore, 1.0.9"
                    
#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 XBullet.EasyTesting.EntityFrameworkCore@1.0.9
                    
#: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=XBullet.EasyTesting.EntityFrameworkCore&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=XBullet.EasyTesting.EntityFrameworkCore&version=1.0.9
                    
Install as a Cake Tool

XBullet.EasyTesting.EntityFrameworkCore

Entity Framework Core database actions and test-factory support for XBullet.EasyTesting integration tests.

The package targets .NET 8, .NET 9, and .NET 10.

Install

dotnet add package XBullet.EasyTesting.EntityFrameworkCore

Derive your test factory from EntityFrameworkWebApplicationFactory<TEntryPoint, TDbContext> to configure an isolated database for each scenario. Tests can seed, query, and execute scoped database actions through the factory while requests still run through the in-memory ASP.NET Core host.

For fast tests that do not require relational database behavior, derive from InMemoryEntityFrameworkWebApplicationFactory<TEntryPoint, TDbContext> instead. It registers the EF Core in-memory provider automatically and creates an isolated database for each test scenario:

public sealed class TestApiFactory
    : InMemoryEntityFrameworkWebApplicationFactory<Program, TestApiDbContext>
{
}

The EF Core in-memory provider does not enforce relational constraints or support transactions. Use EntityFrameworkWebApplicationFactory<TEntryPoint, TDbContext> with SQLite or the same relational provider used in production when those behaviors are relevant to the test.

For an application that exposes IntegrationTestStartup and must not execute Program.Main, use the equivalent Startup-based host. It runs directly on TestServer and keeps the same database and scenario APIs:

public sealed class StartupTestHost
    : StartupEntityFrameworkWebApplicationFactory<IntegrationTestStartup, AppDbContext>
{
    protected override void ConfigureDatabaseServices(IServiceCollection services) =>
        services.AddDbContext<AppDbContext>(options => options.UseSqlite(_connection));
}
var product = await factory.QueryDatabaseAsync(
    (database, cancellationToken) => database.Products
        .SingleAsync(item => item.Id == 42, cancellationToken));

AddDbContextFactory<TContext> is supported as a test registration. Database replacement removes both the application's context and IDbContextFactory<TContext> registrations before adding the test provider.

The default per-scenario lifecycle remains EnsureDeleted followed by EnsureCreated. Override InitializeScenarioDatabaseAsync and CleanupScenarioDatabaseAsync to invoke application migrations, schema verification, template restore, or another initializer. For a single database arrangement, use Database().RecreateDatabaseWith(...).

SQLite file cleanup clears connection pools, retries transient lock failures, and adds a SqliteDatabaseCleanupDiagnostics value to the terminal exception's Data dictionary under SqliteDatabaseCleanupDiagnostics.ExceptionDataKey.

See the repository documentation for factory setup and isolation examples.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
1.0.14 30 9/27/2026
1.0.13 37 9/26/2026
1.0.12 41 9/25/2026
1.0.11 39 9/24/2026
1.0.9 35 9/24/2026
1.0.8 86 9/21/2026
1.0.7 81 9/19/2026
1.0.6 83 9/18/2026
1.0.5 76 9/18/2026
1.0.4 85 9/15/2026
1.0.3 83 9/15/2026
0.2.0 80 9/15/2026
0.1.0 81 9/14/2026