Keploy as a ASP.NET Core testing framework
Keploy tests ASP.NET Core applications by recording real requests through Kestrel and every EF Core query or HttpClient call they trigger, then replaying both as assertions. There is no WebApplicationFactory to build and no service registration to override.
keploy record -c "dotnet Orders.dll"What Keploy gives a ASP.NET Core team
Any ASP.NET Core app, unchanged
Keploy runs the assembly you publish. Minimal APIs, MVC controllers, Razor Pages, and gRPC endpoints all record the same way, because capture happens at the socket rather than inside the middleware pipeline.
- .NET 6 and above
- Minimal APIs, MVC, and Razor Pages
- Kestrel or behind a reverse proxy
- Startup and hosted services run
Why ASP.NET Core integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing ASP.NET Core: by hand, with xUnit + WebApplicationFactory, or with Keploy
WebApplicationFactory boots the pipeline with registrations swapped out. Keploy records the running Kestrel process, so middleware, auth, and the real DI graph all execute.
Select any row for the full comparison, with code.
What you write for ASP.NET Core vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
Fast, and authentication, model binding, and the exception handler registered in Program.cs never run — so an unreachable endpoint still passes.
Drives the real pipeline — and both the payment client and the database are replaced, so the two integrations this test is named for never happen.
The auth middleware authorised this request and EF Core translated a real query — neither of which a test host with overrides exercises.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
ASP.NET Core testing tools, compared
The options a team on .NET actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your ASP.NET Core app once, replay it forever
Keploy sits below your ASP.NET Core process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a ASP.NET Core service and captures the dependency calls it makes.
What Keploy mocks for ASP.NET Core, with zero config
7 of the 7 dependencies a typical ASP.NET Core service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
SQL ServerView page
TDS protocol under EF Core and Dapper
- Auto-mocked
PostgreSQLView page
Postgres protocol under Npgsql
- Auto-mocked
MySQLView page
MySQL protocol under MySqlConnector
- Auto-mocked
RedisView page
RESP under StackExchange.Redis
- Auto-mocked
MongoDBView page
Wire protocol under the MongoDB .NET driver
- Auto-mocked
gRPCView page
HTTP/2 framed calls from Grpc.Net.Client
- Outbound HTTPAuto-mocked
Outbound HTTP
Any HttpClient, Refit, or Polly-wrapped call
Your first ASP.NET Core test suite in under five minutes
Every command below runs against your existing ASP.NET Core service. Nothing in your source tree changes.
1Install the Keploy CLI
A single binary. It needs a Linux kernel with eBPF support, or Docker on macOS and Windows — and it adds nothing to your project's dependencies.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.
keploy record -c "dotnet Orders.dll"3Exercise the paths you care about
Publish as normal, then drive the running app. Every request becomes a test case with its EF Core queries and HttpClient calls captured alongside.
dotnet publish -c Release -o outcurl -X POST localhost:5000/orders/ord_1/confirm -H 'Content-Type: application/json' -H 'Authorization: Bearer $TOKEN' -d '{"paymentToken":"tok_123"}'4Replay in CI
Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.
keploy test -c "dotnet Orders.dll" --delay 12
Ready to try it on your own ASP.NET Core service?
Works with the rest of your ASP.NET Core stack
Keploy records at the network layer, so framework and driver choices inside your ASP.NET Core app do not change how it captures traffic.
.NET
The language page covers driver-level coverage in depth.
Entity Framework Core
Queries record as the SQL they translate to.
SQL Server
The database page covers TDS-level capture in depth.
Redis
StackExchange.Redis exchanges record in order.
gRPC
Grpc.Net.Client calls captured as HTTP/2 frames.
Docker
Record in a container or on the host; replay needs neither.
Testing the rest of your stack
- Languages
Keploy as a .NET testing framework
Test ASP.NET Core services against recorded EF Core queries and HTTP calls, without Moq setups or an in-memory provider.
Read the guide - Databases
Keploy as a SQL Server testing framework
Mock SQL Server at the TDS protocol instead of standing up a container or swapping in an in-memory provider.
Read the guide - Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Caches & Stores
Keploy as a Redis testing framework
Record RESP traffic once and replay real cache hits, misses, TTLs, and pipeline responses without a Redis server in CI.
Read the guide - Cloud & Infra
Keploy as a gRPC testing framework
Record real gRPC exchanges over HTTP/2 and replay them as tests — no in-process stub server, no hand-written mock service implementation.
Read the guide - Databases
Keploy as a MongoDB testing framework
Mock MongoDB at the wire protocol — real documents, real BSON types, real aggregation results — without a mongod binary in CI.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0