Class TestKit
This class represents an Akka.NET TestKit that uses xUnit as its testing framework.
Inherited Members
Namespace: Akka.TestKit.Xunit
Assembly: Akka.TestKit.Xunit.dll
Syntax
public class TestKit : TestKitBase, IActorRefFactory, IDisposable
Constructors
| Improve this Doc View SourceTestKit(ActorSystem, ITestOutputHelper)
Initializes a new instance of the TestKit class.
If no system
is passed in, a new system with
DefaultConfig will be created.
Declaration
public TestKit(ActorSystem system = null, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system to use for testing. The default value is null. |
Xunit.Abstractions.ITestOutputHelper | output | The provider used to write test output. The default value is null. |
TestKit(ActorSystemSetup, String, ITestOutputHelper)
Initializes a new instance of the TestKit class.
Declaration
public TestKit(ActorSystemSetup config, string actorSystemName = null, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
ActorSystemSetup | config | The Setup to use for configuring the ActorSystem. |
String | actorSystemName | The name of the system. The default name is "test". |
Xunit.Abstractions.ITestOutputHelper | output | The provider used to write test output. The default value is null. |
TestKit(Config, String, ITestOutputHelper)
Initializes a new instance of the TestKit class.
Declaration
public TestKit(Config config, string actorSystemName = null, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The configuration to use for the system. |
String | actorSystemName | The name of the system. The default name is "test". |
Xunit.Abstractions.ITestOutputHelper | output | The provider used to write test output. The default value is null. |
TestKit(String, ITestOutputHelper)
Initializes a new instance of the TestKit class.
Declaration
public TestKit(string config, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
String | config | The configuration to use for the system. |
Xunit.Abstractions.ITestOutputHelper | output | The provider used to write test output. The default value is null. |
Fields
| Improve this Doc View SourceOutput
The provider used to write test output.
Declaration
protected readonly ITestOutputHelper Output
Field Value
Type | Description |
---|---|
Xunit.Abstractions.ITestOutputHelper |
Properties
| Improve this Doc View SourceAssertions
Commonly used assertions used throughout the testkit.
Declaration
protected static XunitAssertions Assertions { get; }
Property Value
Type | Description |
---|---|
XunitAssertions |
DefaultConfig
A configuration that has just the default log settings enabled. The default settings can be found in Akka.TestKit.Internal.Reference.conf.
Declaration
public static Config DefaultConfig { get; }
Property Value
Type | Description |
---|---|
Config |
FullDebugConfig
A configuration that has all log settings enabled
Declaration
public static Config FullDebugConfig { get; }
Property Value
Type | Description |
---|---|
Config |
Methods
| Improve this Doc View SourceAfterAll()
This method is called when a test ends.
base.AfterTest()
or
TestKitBase.Shutdown
to shut down the system. Otherwise a memory leak will occur.
Declaration
protected virtual void AfterAll()
Dispose()
Declaration
public void Dispose()
Dispose(Boolean)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing | if set to |
InitializeLogger(ActorSystem)
Initializes a new TestOutputLogger used to log messages.
Declaration
protected void InitializeLogger(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system used to attach the logger |