Aspire Integration Testing
DevBetterCom/DevBetterWeb
Write integration tests using .NET Aspire's testing facilities with xUnit.
Shows how to test Akka.NET actors with Akka.Hosting.TestKit: swapping services for fakes, using TestProbes, and checking persistence, plus when the older TestKit still fits.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-net-testing-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/akka-testing-patterns .claude/skills/akka-net-testing-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "akka-net-testing-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patterns into .claude/skills/akka-net-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-net-testing-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-net-testing-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/akka-testing-patterns .agents/skills/akka-net-testing-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "akka-net-testing-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patterns into .agents/skills/akka-net-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-net-testing-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-net-testing-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/akka-testing-patterns .cursor/skills/akka-net-testing-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "akka-net-testing-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patterns into .cursor/skills/akka-net-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-net-testing-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/Aaronontheweb/dotnet-skills.git --path skills/akka-testing-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-net-testing-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/akka-testing-patterns .gemini/skills/akka-net-testing-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "akka-net-testing-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patterns into .gemini/skills/akka-net-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-net-testing-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install Aaronontheweb/dotnet-skills akka-net-testing-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/akka-testing-patterns .github/skills/akka-net-testing-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "akka-net-testing-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patterns into .github/skills/akka-net-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-net-testing-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install Aaronontheweb/dotnet-skills akka-net-testing-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/Aaronontheweb/dotnet-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/akka-testing-patterns .opencode/skills/akka-net-testing-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "akka-net-testing-patterns" agent skill from https://github.com/Aaronontheweb/dotnet-skills/tree/master/skills/akka-testing-patterns into .opencode/skills/akka-net-testing-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "akka-net-testing-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
akka-net-testing-patternsShows how to test Akka.NET actors with Akka.Hosting.TestKit: swapping services for fakes, using TestProbes, and checking persistence, plus when the older TestKit still fits.
This skill steers tests for Akka.NET actors toward Akka.Hosting.TestKit, which it recommends for roughly 95% of cases: modern .NET applications that already use Microsoft.Extensions.DependencyInjection and configure actors through Akka.Hosting. A test class inherits the framework's TestKit base class, overrides ConfigureServices() to replace real services with fakes, and overrides ConfigureAkka() to wire actors with the same extension methods production uses.
The remaining principles are to fetch actor references through the type-safe ActorRegistry, keep fake services as fields instead of building custom base classes, and test one actor at a time with TestProbes standing in for its dependencies. Two reference files hold complete code samples for eight numbered patterns plus the anti-patterns. The traditional Akka.TestKit approach is kept for work on the Akka.NET core library, environments without Microsoft.Extensions, and legacy code that builds actors by hand with Props.
8 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit e426ed9. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are csharp and xml).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Akka.NET Testing Patterns loads about 2.4k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 785 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from Aaronontheweb/dotnet-skills at commit e426ed9, republished under its MIT licence (© Aaronontheweb). 785 words, ~2,442 tokens.
.claude/skills/akka-net-testing-patterns/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Use this skill when:
When:
Microsoft.Extensions.DependencyInjectionIOptions, DbContext, ILogger, HTTP clients, etc.)Advantages:
When:
Microsoft.Extensions (console apps, legacy systems)Props creation without DISee anti-patterns-and-reference.md for traditional TestKit patterns.
Akka.Hosting.TestKit.TestKit - This is a framework base class, not a user-defined oneConfigureServices() - Replace real services with fakes/mocksConfigureAkka() - Configure actors using the same extension methods as productionActorRegistry - Type-safe retrieval of actor referencesAkkaExecutionMode<ItemGroup>
<!-- Core testing framework -->
<PackageReference Include="Akka.Hosting.TestKit" Version="*" />
<!-- xUnit (or your preferred test framework) -->
<PackageReference Include="xunit" Version="*" />
<PackageReference Include="xunit.runner.visualstudio" Version="*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="*" />
<!-- Assertions (recommended) -->
<PackageReference Include="FluentAssertions" Version="*" />
<!-- In-memory persistence for testing -->
<PackageReference Include="Akka.Persistence.Hosting" Version="*" />
<!-- If testing cluster sharding -->
<PackageReference Include="Akka.Cluster.Hosting" Version="*" />
</ItemGroup>Akka.Hosting.TestKit spins up real IHost instances, which by default enable file watchers for configuration reload. When running many tests, this exhausts file descriptor limits on Linux (inotify watch limit).
Add this to your test project - it runs before any tests execute:
// TestEnvironmentInitializer.cs
using System.Runtime.CompilerServices;
namespace YourApp.Tests;
internal static class TestEnvironmentInitializer
{
[ModuleInitializer]
internal static void Initialize()
{
// Disable config file watching in test hosts
// Prevents file descriptor exhaustion (inotify watch limit) on Linux
Environment.SetEnvironmentVariable("DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE", "false");
}
}Why this matters:
[ModuleInitializer] runs automatically before any test codeIHost instancesinotify errors when running 100+ testsIHostEach pattern below has a condensed description. See examples.md for complete code samples.
The foundation pattern. Override ConfigureServices() to inject fakes, override ConfigureAkka() to register actors with the same extension methods as production.
public class OrderActorTests : TestKit
{
private readonly FakeOrderRepository _fakeRepository = new();
protected override void ConfigureServices(HostBuilderContext context, IServiceCollection services)
{
services.AddSingleton<IOrderRepository>(_fakeRepository);
}
protected override void ConfigureAkka(AkkaConfigurationBuilder builder, IServiceProvider provider)
{
builder.WithInMemoryJournal().WithInMemorySnapshotStore();
builder.WithActors((system, registry, resolver) =>
{
registry.Register<OrderActor>(system.ActorOf(resolver.Props<OrderActor>(), "order-actor"));
});
}
[Fact]
public async Task CreateOrder_Success_SavesToRepository()
{
var orderActor = ActorRegistry.Get<OrderActor>();
var response = await orderActor.Ask<OrderCommandResult>(
new CreateOrder("ORDER-123", "CUST-456", 99.99m), RemainingOrDefault);
response.Status.Should().Be(CommandStatus.Success);
_fakeRepository.SaveCallCount.Should().Be(1);
}
}Register a TestProbe in the ActorRegistry as a stand-in for a dependency actor. Use ExpectMsgAsync<T>() to verify messages were sent.
When the actor under test uses Ask to communicate with dependencies, create an auto-responder actor that forwards messages to a probe AND replies to avoid timeouts.
Use WithInMemoryJournal() and WithInMemorySnapshotStore(). Test recovery by killing the actor with PoisonPill and querying to force recovery from journal.
Always reuse production extension methods in tests instead of duplicating HOCON config. This ensures tests use the exact same configuration as production.
protected override void ConfigureAkka(AkkaConfigurationBuilder builder, IServiceProvider provider)
{
builder
.AddDraftSerializer() // Same as production
.AddOrderDomainActors(AkkaExecutionMode.LocalTest) // Same, but local mode
.WithInMemoryJournal().WithInMemorySnapshotStore(); // Test-specific overrides
}Use AkkaExecutionMode.LocalTest with GenericChildPerEntityParent to test sharding behavior without an actual cluster. Same extension methods, different mode.
Use AwaitAssertAsync when actors perform async operations. It retries assertions until they pass or timeout, preventing flaky tests.
await AwaitAssertAsync(() =>
{
_fakeReadModelService.SyncCallCount.Should().BeGreaterOrEqualTo(1);
}, TimeSpan.FromSeconds(3));Test complete business workflows end-to-end with multiple actors and state transitions. Register all domain actors, verify state at each step.
| Pattern | Use Case |
|---|---|
| Basic Actor Test | Single actor with injected services |
| TestProbe | Verify actor sends messages to dependencies |
| Auto-Responder | Avoid Ask timeouts when testing |
| Persistent Actor | Test event sourcing and recovery |
| Cluster Sharding | Test sharding behavior locally |
| AwaitAssertAsync | Handle async operations in actors |
| Scenario Tests | End-to-end business workflows |
AkkaExecutionModeScenario_FirstTimePurchase_SuccessfulPaymentLogLevel.Debug to TestKit constructorprobe.Messages to see what was sent// Constructor with debug logging
public OrderActorTests(ITestOutputHelper output)
: base(output: output, logLevel: LogLevel.Debug)
{
}© Aaronontheweb, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files in skills/akka-testing-patterns of Aaronontheweb/dotnet-skills.
Open the folder on GitHubat commit e426ed9
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Aaronontheweb/dotnet-skills, which our catalogue first saw on October 7, 2026.
Akka.NET Testing Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Akka.NET Testing Patterns this skillAaronontheweb/dotnet-skills | 1.2k | 1 repos | ~2.4k | Automated safety check: Pass | MIT | |
| Aspire Integration TestingDevBetterCom/DevBetterWeb | 157 | 2 repos | ~2.3k | Automated safety check: Pass | None | |
| Dotnet Testingnovotnyllc/dotnet-artisan | 233 | — | ~972 | Automated safety check: Pass | MIT | |
| Csharp Testingaffaan-m/ECC | 275k | 1 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Fsharp Testingaffaan-m/ECC | 275k | 1 repos | ~2k | Automated safety check: Pass | MIT | |
| New Event Sourceaws/aws-lambda-dotnet | 1.7k | — | ~3k | Automated safety check: Pass | Apache-2.0 |
DevBetterCom/DevBetterWeb
Write integration tests using .NET Aspire's testing facilities with xUnit.
novotnyllc/dotnet-artisan
Defines .NET test strategy and implementation patterns across xUnit v3 (Facts, Theories, fixtures, IAsyncLifetime), integration testing (WebApplicationFactory, Testcontainers), Aspire testing…
affaan-m/ECC
C and .NET testing patterns with xUnit, FluentAssertions, mocking, integration tests, and test organization best practices.
affaan-m/ECC
F testing patterns with xUnit, FsUnit, Unquote, FsCheck property-based testing, integration tests, and test organization best practices.
aws/aws-lambda-dotnet
Add a new AWS event source attribute (e.g., Kinesis, Kafka, MQ) to the Lambda .NET Annotations framework, including the attribute class, source generator integration, CloudFormation writer, unit…
CloudAI-X/claude-workflow-v2
Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.
Aaronontheweb/dotnet-skills
Applies extend-only design rules to NuGet packages and distributed systems, covering source, binary and wire compatibility and how to deprecate members safely.
Aaronontheweb/dotnet-skills
Guides making .NET libraries trimming-safe and Native-AOT compatible: the MSBuild properties, trimming attributes, warning codes and a playbook of safe patterns.
Aaronontheweb/dotnet-skills
Shows how to build entity actors with Akka.Hosting so the same code runs in local unit tests and in a sharded cluster in production.
Aaronontheweb/dotnet-skills
Guidance for Akka.NET actor systems covering EventStream versus DistributedPubSub, supervision, Props versus DependencyResolver, work distribution and testable cluster code.
Aaronontheweb/dotnet-skills
Sets up Akka.Management and Cluster.Bootstrap so Akka.NET clusters form through service discovery on Kubernetes, Azure or config instead of static seed nodes.
Aaronontheweb/dotnet-skills
Wires .NET Aspire AppHost resources into explicit environment-variable configuration, keeping application code free of Aspire client packages and service discovery.
Works with
Categories
Shows how to test Akka.NET actors with Akka.Hosting.TestKit: swapping services for fakes, using TestProbes, and checking persistence, plus when the older TestKit still fits. Hosting. A test class inherits the framework's TestKit base class, overrides ConfigureServices() to replace real services with fakes, and overrides ConfigureAkka() to wire actors with the same extension methods production uses.
Akka.NET Testing Patterns fits situations like: writing unit tests for Akka.NET actors that take injected services; testing persistent actors and their recovery from stored events; checking message flows between actors with TestProbes; deciding between Akka.Hosting.TestKit and the traditional TestKit.
Run `npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a claude-code`. Or copy the skill folder (skills/akka-testing-patterns in Aaronontheweb/dotnet-skills) into .claude/skills/akka-net-testing-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a codex`. Or copy the skill folder (skills/akka-testing-patterns in Aaronontheweb/dotnet-skills) into .agents/skills/akka-net-testing-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Aaronontheweb/dotnet-skills --skill akka-net-testing-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/akka-net-testing-patterns, .gemini/skills/akka-net-testing-patterns, .github/skills/akka-net-testing-patterns and .opencode/skills/akka-net-testing-patterns in your project.
SKILL.md names no scripts, command-line tools or credentials: Akka.NET Testing Patterns is instructions for the agent only. Our summary lists: A .NET project using Akka.NET v1.5 or later with Akka.Hosting.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Akka.NET Testing Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Akka.NET Testing Patterns: Aspire Integration Testing (DevBetterCom/DevBetterWeb, 157 stars), Dotnet Testing (novotnyllc/dotnet-artisan, 233 stars), Csharp Testing (affaan-m/ECC, 275k stars) and Fsharp Testing (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Aaronontheweb (a GitHub user) maintains it in Aaronontheweb/dotnet-skills, which has 1,203 GitHub stars. The repository holds 33 skills in this directory. The repository was last updated on September 17, 2026.
Source: Aaronontheweb/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.