Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/articles/actors/testing-actor-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ akka {

There are several configuration properties for the TestKit module, please refer to the [reference configuration](https://github.com/akkadotnet/akka.net/blob/master/src/core/Akka.TestKit/Configs/TestScheduler.conf)

TODO describe how to pass custom config
### How To Pass Custom Configuration To Akka.TestKit

[!code-csharp[Main](../../../src/contrib/cluster/Akka.Cluster.Tools.Tests/Singleton/ClusterSingletonConfigSpec.cs?name=ClusterSingletonConfigSpec)]

From the above sample, custom configuration, `GetConfig()`, is passed to `Akka.TestKit` via the base class constructor!

## Synchronous Testing: TestActorRef

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// </copyright>
//-----------------------------------------------------------------------



using System;
using Akka.Cluster.Tools.Singleton;
using Akka.Configuration;
Expand All @@ -13,6 +15,7 @@

namespace Akka.Cluster.Tools.Tests.Singleton
{
// <ClusterSingletonConfigSpec>
Comment thread
Aaronontheweb marked this conversation as resolved.
public class ClusterSingletonConfigSpec : TestKit.Xunit2.TestKit
{
public ClusterSingletonConfigSpec() : base(GetConfig())
Expand All @@ -24,7 +27,7 @@ public static Config GetConfig()
return ConfigurationFactory.ParseString(@"akka.actor.provider = cluster
akka.remote.dot-netty.tcp.port = 0");
}

// </ClusterSingletonConfigSpec>
[Fact]
public void ClusterSingletonManagerSettings_must_have_default_config()
{
Expand Down Expand Up @@ -54,3 +57,4 @@ public void ClusterSingletonProxySettings_must_have_default_config()
}
}
}