Class TestKit
This class represents an Akka.NET TestKit that uses xUnit as its testing framework.
Inheritance
Inherited Members
Namespace: Akka.TestKit.Xunit2
Assembly: Akka.TestKit.Xunit2.dll
Syntax
public class TestKit : TestKitBase, IActorRefFactory, IDisposable
Constructors
| Edit this page 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. |
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". |
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". |
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. |
ITestOutputHelper | output | The provider used to write test output. The default value is null. |
Fields
| Edit this page View SourceOutput
The provider used to write test output.
Declaration
protected readonly ITestOutputHelper Output
Field Value
Type | Description |
---|---|
ITestOutputHelper |
Properties
| Edit this page 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
| Edit this page View SourceAfterAll()
This method is called when a test ends.
Declaration
protected virtual void AfterAll()
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | 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 |
InitializeLogger(ActorSystem, string)
Declaration
protected void InitializeLogger(ActorSystem system, string prefix)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | |
string | prefix |