Agent skill · software engineering · aaronontheweb
akka-net-testing-patterns
Write unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, and actor interaction verification. Includes guidance on when to use traditional TestKit.
Why this skill is useful
Provides specific patterns and practices for testing Akka.NET actors that the AI wouldn't reliably generate on its own.
What it needs
Requires akka.cluster.hosting, akka.hosting.testkit, akka.persistence.hosting, fluentassertions, microsoft.net.test.sdk, xunit, xunit.runner.visualstudio installed locally. About 5k tokens when loaded. Last updated 2026-07-03. 1,095 stars on the source repository.
What this skill does
Akka.NET Testing Patterns When to Use This Skill Use this skill when: Writing unit tests for Akka.NET actors Testing persistent actors with event sourcing Verifying actor interactions and message flows Testing actor supervision and lifecycle Mocking external dependencies in actor tests Testing cluster sharding behavior locally Verifying actor state recovery and persistence Reference Files examples.md: Complete code samples for all testing patterns (Patterns 1-8 plus Reminders) anti-patterns-and-reference.md: Anti-patterns, traditional TestKit, CI/CD integration Choosing Your Testing Approach Use Akka.Hosting.TestKit (Recommended for 95% of Use Cases) When: Building modern .NET applications with Microsoft.Extensions.DependencyInjection Using Akka.Hosting for actor configuration in production Need to inject services into actors (IOptions, DbContext, ILogger, HTTP clients, etc.) Testing applications that use ASP.NET Core, Worker Services, or .NET Aspire Working with modern Akka.NET projects (Akka.NET v1.5+) Advantages: Native dependency injection support - override services with fakes in tests Configuration parity with production (same extension methods work in tests) Clean separation between actor logic and infrastructure Type-safe actor registry for retrieving actors Use Traditional Akka.TestKit When: Contributing to Akka.NET core library development Working in environments without Microsoft.Extensions (console apps, legacy systems) Legacy codebases using manual Props creation without DI See anti-patterns-and-reference.md for traditional TestKit patterns. --- Core Principles (Akka.Hosting.TestKit) 1. Inherit from Akka.Hosting.TestKit.TestKit - This is a framework base class, not a user-defined one 2. Override ConfigureServices() - Replace real services with fakes/mocks 3. Override ConfigureAkka() - Configure actors using the same extension methods as production 4. Use ActorRegistry - Type-safe retrieval of actor references 5. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aaronontheweb/akka-testing-patterns