Ploch.Data.EFCore.IntegrationTesting 4.0.1

dotnet add package Ploch.Data.EFCore.IntegrationTesting --version 4.0.1
                    
NuGet\Install-Package Ploch.Data.EFCore.IntegrationTesting -Version 4.0.1
                    
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="Ploch.Data.EFCore.IntegrationTesting" Version="4.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ploch.Data.EFCore.IntegrationTesting" Version="4.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ploch.Data.EFCore.IntegrationTesting" />
                    
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 Ploch.Data.EFCore.IntegrationTesting --version 4.0.1
                    
#r "nuget: Ploch.Data.EFCore.IntegrationTesting, 4.0.1"
                    
#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 Ploch.Data.EFCore.IntegrationTesting@4.0.1
                    
#: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=Ploch.Data.EFCore.IntegrationTesting&version=4.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ploch.Data.EFCore.IntegrationTesting&version=4.0.1
                    
Install as a Cake Tool

Ploch.Data.EFCore.IntegrationTesting

Base class and helpers for EF Core integration tests using in-memory SQLite databases.

Key Features

  • DataIntegrationTest<TDbContext> -- abstract base class that configures an in-memory SQLite database, creates the schema, and provides DbContext and ServiceProvider properties
  • DbContextServicesRegistrationHelper -- static helper for building the service provider and preparing the DbContext
  • Custom configurator support -- pass any IDbContextConfigurator to use a different database provider

Installation

<PackageReference Include="Ploch.Data.EFCore.IntegrationTesting" />

For repository and Unit of Work testing helpers, use Ploch.Data.GenericRepository.EFCore.IntegrationTesting instead.

Quick Start

using Ploch.Data.EFCore.IntegrationTesting;

public class MyDbContextTests : DataIntegrationTest<MyDbContext>
{
    [Fact]
    public async Task CanAddEntities()
    {
        DbContext.Products.Add(new Product { Title = "Test" });
        await DbContext.SaveChangesAsync();

        var count = await DbContext.Products.CountAsync();
        count.Should().Be(1);
    }

    protected override void ConfigureServices(IServiceCollection services)
    {
        base.ConfigureServices(services);
        // Register additional services here
    }
}

Documentation

See the Integration Testing Guide for detailed patterns, examples, and testing strategies.

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 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on Ploch.Data.EFCore.IntegrationTesting:

Package Downloads
Ploch.Data.GenericRepository.EFCore.IntegrationTesting

Generic Repository, Unit of Work and Data Utilities

Ploch.Common.Data.GenericRepository.EFCore.IntegrationTesting

Generic Repository, Unit of Work and Data Utilities

Ploch.Data.EFCore.IntegrationTesting.FluentAssertions

Generic Repository, Unit of Work and Data Utilities

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1 77 9/10/2026
2.1.0 250 11/3/2024
2.0.0 239 6/7/2024
2.0.0-prerelease-240607015317 188 6/7/2024
1.0.0 234 6/7/2024