ActorTestKit<T> class
Provides methods for testing an actor of type T in isolation.
public sealed class ActorTestKit<T>
where T : Actor
parameter |
description |
T |
The actor type to test. |
Public Members
name |
description |
ActorTestKit(…) |
Initializes a new instance of the ActorTestKit class. |
Logger { get; set; } |
Gets or sets an ILogger for logging runtime messages. |
readonly ActorInstance |
The instance of the actor being tested. |
Assert(…) |
Asserts if the specified condition holds. (5 methods) |
AssertInboxSize(…) |
Asserts that the actor inbox contains the specified number of events. |
AssertIsWaitingToReceiveEvent(…) |
Asserts that the actor is waiting (or not) to receive an event. |
AssertStateTransition(…) |
If the actor is a state machine, asserts that the state machine has transitioned to the state with the specified name (either FullName or Name). |
AssertStateTransition<TState>() |
If the actor is a state machine, this asserts that the state machine has transitioned to the state with the specified type T. |
Invoke(…) |
Invokes the actor method with the specified name, and passing the specified optional parameters. Use this method to invoke private methods of the actor. (2 methods) |
InvokeAsync(…) |
Invokes the asynchronous actor method with the specified name, and passing the specified optional parameters. Use this method to invoke private methods of the actor. (2 methods) |
SendEventAsync(…) |
Sends an event to the actor and starts its event handler. This method returns a task that completes when the actor reaches quiescence (typically when the event handler finishes executing because there are not more events to dequeue, or when the actor asynchronously waits to receive an event). |
StartActorAsync(…) |
Initializes the actor, passes the optional specified event and invokes its on-entry handler, if there is one available. This method returns a task that completes when the actor reaches quiescence (typically when the event handler finishes executing because there are not more events to dequeue, or when the actor asynchronously waits to receive an event). If the actor is a state machine it also transitions the actor to its start state. |
See Also