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
| Edit this page View SourcePersistenceTestKit(ActorSystem, ITestOutputHelper)
Declaration
public PersistenceTestKit(ActorSystem actorSystem, ITestOutputHelper output = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | actorSystem | |
| 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 |
| 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 |
| 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 |
| ITestOutputHelper | output | TBD |
Properties
| Edit this page 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
| Edit this page 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 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 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 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 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 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.
Edit this page