Tooluck logoTooluck
SKILL.md

akka-net-testing-patterns

Agent skill fromAaronontheweb/dotnet-skills

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.

How to install akka-net-testing-patterns

install akka-net-testing-patterns
# install the dotnet-skills pack with the skills CLI
npx skills add Aaronontheweb/dotnet-skills

# or add only this skill to Claude Code: copy the folder

skills/akka-testing-patterns/

# into

~/.claude/skills/akka-testing-patterns/ (all projects)

.claude/skills/akka-testing-patterns/ (one project)

skills/akka-testing-patterns/SKILL.md

MITFull file
1# Akka.NET Testing Patterns
2
3## When to Use This Skill
4
5Use this skill when:
6- Writing unit tests for Akka.NET actors
7- Testing persistent actors with event sourcing
8- Verifying actor interactions and message flows
9- Testing actor supervision and lifecycle
10- Mocking external dependencies in actor tests
11- Testing cluster sharding behavior locally
12- Verifying actor state recovery and persistence
13
14## Reference Files
15
16- [examples.md](examples.md): Complete code samples for all testing patterns (Patterns 1-8 plus Reminders)
17- [anti-patterns-and-reference.md](anti-patterns-and-reference.md): Anti-patterns, traditional TestKit, CI/CD integration
18
19## Choosing Your Testing Approach
20
21### Use Akka.Hosting.TestKit (Recommended for 95% of Use Cases)
22
23**When:**
24- Building modern .NET applications with `Microsoft.Extensions.DependencyInjection`
25- Using Akka.Hosting for actor configuration in production
26- Need to inject services into actors (`IOptions`, `DbContext`, `ILogger`, HTTP clients, etc.)
27- Testing applications that use ASP.NET Core, Worker Services, or .NET Aspire
28- Working with modern Akka.NET projects (Akka.NET v1.5+)
29
30**Advantages:**
31- Native dependency injection support - override services with fakes in tests
32- Configuration parity with production (same extension methods work in tests)
33- Clean separation between actor logic and infrastructure
34- Type-safe actor registry for retrieving actors
35
36### Use Traditional Akka.TestKit
37
38**When:**
39…

Excerpt shown under the repository's MIT license.

More skills in dotnet-skills

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates