Class PersistenceTestKit
This class represents an Akka.NET Persistence TestKit that uses xUnit as its testing framework.
Inherited Members
Namespace: Akka.Persistence.TestKit
Assembly: Akka.Persistence.TestKit.Xunit2.dll
Syntax
public class PersistenceTestKit : TestKit, IActorRefFactory, IDisposable
Constructors
| Improve this Doc View SourcePersistenceTestKit(ActorSystem, ITestOutputHelper)
Declaration
public PersistenceTestKit(ActorSystem actorSystem, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | actorSystem | |
Xunit.Abstractions.ITestOutputHelper | output |
PersistenceTestKit(ActorSystemSetup, String, ITestOutputHelper)
Create a new instance of the PersistenceTestKit class. A new system with the specified configuration will be created.
Declaration
public PersistenceTestKit(ActorSystemSetup setup, string actorSystemName = null, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
ActorSystemSetup | setup | Test ActorSystem configuration |
String | actorSystemName | Optional: The name of the actor system |
Xunit.Abstractions.ITestOutputHelper | output | TBD |
PersistenceTestKit(Config, String, ITestOutputHelper)
Create a new instance of the PersistenceTestKit class. A new system with the specified configuration will be created.
Declaration
public PersistenceTestKit(Config config, string actorSystemName = null, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
Config | config | Test ActorSystem configuration |
String | actorSystemName | Optional: The name of the actor system |
Xunit.Abstractions.ITestOutputHelper | output | TBD |
PersistenceTestKit(String, ITestOutputHelper)
Create a new instance of the PersistenceTestKit class. A new system with the default configuration will be created.
Declaration
public PersistenceTestKit(string actorSystemName = null, ITestOutputHelper output = null)
Parameters
Type | Name | Description |
---|---|---|
String | actorSystemName | Optional: The name of the actor system |
Xunit.Abstractions.ITestOutputHelper | output | TBD |
Properties
| Improve this Doc View SourceJournal
Declaration
public ITestJournal Journal { get; }
Property Value
Type | Description |
---|---|
ITestJournal |
JournalActorRef
Actor reference to persistence Journal used by current actor system.
Declaration
public IActorRef JournalActorRef { get; }
Property Value
Type | Description |
---|---|
IActorRef |
Snapshots
Declaration
public ITestSnapshotStore Snapshots { get; }
Property Value
Type | Description |
---|---|
ITestSnapshotStore |
SnapshotsActorRef
Actor reference to persistence Snapshot Store used by current actor system.
Declaration
public IActorRef SnapshotsActorRef { get; }
Property Value
Type | Description |
---|---|
IActorRef |
Methods
| Improve this Doc View SourceWithJournalRecovery(Func<JournalRecoveryBehavior, Task>, Action)
Execute execution
delegate with Journal Behavior applied to Recovery operation.
Declaration
public Task WithJournalRecovery(Func<JournalRecoveryBehavior, Task> behaviorSelector, Action execution)
Parameters
Type | Name | Description |
---|---|---|
Func<JournalRecoveryBehavior, Task> | behaviorSelector | Delegate which will select Journal behavior. |
Action | execution | Delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Recovery behavior will be reverted back to normal.
WithJournalRecovery(Func<JournalRecoveryBehavior, Task>, Func<Task>)
Execute execution
delegate with Journal Behavior applied to Recovery operation.
Declaration
public async Task WithJournalRecovery(Func<JournalRecoveryBehavior, Task> behaviorSelector, Func<Task> execution)
Parameters
Type | Name | Description |
---|---|---|
Func<JournalRecoveryBehavior, Task> | behaviorSelector | Delegate which will select Journal behavior. |
Func<Task> | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Recovery behavior will be reverted back to normal.
WithJournalWrite(Func<JournalWriteBehavior, Task>, Action)
Execute execution
delegate with Journal Behavior applied to Write operation.
Declaration
public Task WithJournalWrite(Func<JournalWriteBehavior, Task> behaviorSelector, Action execution)
Parameters
Type | Name | Description |
---|---|---|
Func<JournalWriteBehavior, Task> | behaviorSelector | Delegate which will select Journal behavior. |
Action | execution | Delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Write behavior will be reverted back to normal.
WithJournalWrite(Func<JournalWriteBehavior, Task>, Func<Task>)
Execute execution
delegate with Journal Behavior applied to Write operation.
Declaration
public async Task WithJournalWrite(Func<JournalWriteBehavior, Task> behaviorSelector, Func<Task> execution)
Parameters
Type | Name | Description |
---|---|---|
Func<JournalWriteBehavior, Task> | behaviorSelector | Delegate which will select Journal behavior. |
Func<Task> | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Write behavior will be reverted back to normal.
WithSnapshotDelete(Func<SnapshotStoreDeleteBehavior, Task>, Action)
Execute execution
delegate with Snapshot Store Behavior applied to Delete operation.
Declaration
public Task WithSnapshotDelete(Func<SnapshotStoreDeleteBehavior, Task> behaviorSelector, Action execution)
Parameters
Type | Name | Description |
---|---|---|
Func<SnapshotStoreDeleteBehavior, Task> | behaviorSelector | Delegate which will select Snapshot Store behavior. |
Action | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Delete behavior will be reverted back to normal.
WithSnapshotDelete(Func<SnapshotStoreDeleteBehavior, Task>, Func<Task>)
Execute execution
delegate with Snapshot Store Behavior applied to Delete operation.
Declaration
public async Task WithSnapshotDelete(Func<SnapshotStoreDeleteBehavior, Task> behaviorSelector, Func<Task> execution)
Parameters
Type | Name | Description |
---|---|---|
Func<SnapshotStoreDeleteBehavior, Task> | behaviorSelector | Delegate which will select Snapshot Store behavior. |
Func<Task> | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Delete behavior will be reverted back to normal.
WithSnapshotLoad(Func<SnapshotStoreLoadBehavior, Task>, Action)
Execute execution
delegate with Snapshot Store Behavior applied to Load operation.
Declaration
public Task WithSnapshotLoad(Func<SnapshotStoreLoadBehavior, Task> behaviorSelector, Action execution)
Parameters
Type | Name | Description |
---|---|---|
Func<SnapshotStoreLoadBehavior, Task> | behaviorSelector | Delegate which will select Snapshot Store behavior. |
Action | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Load behavior will be reverted back to normal.
WithSnapshotLoad(Func<SnapshotStoreLoadBehavior, Task>, Func<Task>)
Execute execution
delegate with Snapshot Store Behavior applied to Load operation.
Declaration
public async Task WithSnapshotLoad(Func<SnapshotStoreLoadBehavior, Task> behaviorSelector, Func<Task> execution)
Parameters
Type | Name | Description |
---|---|---|
Func<SnapshotStoreLoadBehavior, Task> | behaviorSelector | Delegate which will select Snapshot Store behavior. |
Func<Task> | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Load behavior will be reverted back to normal.
WithSnapshotSave(Func<SnapshotStoreSaveBehavior, Task>, Action)
Execute execution
delegate with Snapshot Store Behavior applied to Save operation.
Declaration
public Task WithSnapshotSave(Func<SnapshotStoreSaveBehavior, Task> behaviorSelector, Action execution)
Parameters
Type | Name | Description |
---|---|---|
Func<SnapshotStoreSaveBehavior, Task> | behaviorSelector | Delegate which will select Snapshot Store behavior. |
Action | execution | Delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Save behavior will be reverted back to normal.
WithSnapshotSave(Func<SnapshotStoreSaveBehavior, Task>, Func<Task>)
Execute execution
delegate with Snapshot Store Behavior applied to Save operation.
Declaration
public async Task WithSnapshotSave(Func<SnapshotStoreSaveBehavior, Task> behaviorSelector, Func<Task> execution)
Parameters
Type | Name | Description |
---|---|---|
Func<SnapshotStoreSaveBehavior, Task> | behaviorSelector | Delegate which will select Snapshot Store behavior. |
Func<Task> | execution | Async delegate which will be executed with applied Journal behavior. |
Returns
Type | Description |
---|---|
Task | Task which must be awaited. |
Remarks
After execution
will be executed, Save behavior will be reverted back to normal.