Class TestActorRef<TActor>
This special ActorRef is exclusively for use during unit testing in a single-threaded environment. Therefore, it overrides the dispatcher to CallingThreadDispatcher and sets the receiveTimeout to None. Otherwise, it acts just like a normal ActorRef. You may retrieve a reference to the underlying actor to test internal logic. A TestActorRef<TActor> can be implicitly casted to an IActorRef or you can get the actual IActorRef from the Ref property.
Inherited Members
Namespace: Akka.TestKit
Assembly: Akka.TestKit.dll
Syntax
public class TestActorRef<TActor> : TestActorRefBase<TActor>, IActorRef, ICanTell, IEquatable<IActorRef>, IComparable<IActorRef>, ISurrogated, IComparable where TActor : ActorBase
Type Parameters
Name | Description |
---|---|
TActor | The type of actor |
Constructors
| Edit this page View SourceTestActorRef(ActorSystem, Props, IActorRef, string)
Initializes a new instance of the TestActorRef<TActor> class.
Declaration
public TestActorRef(ActorSystem system, Props actorProps, IActorRef supervisor = null, string name = null)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The system. |
Props | actorProps | The actor props. |
IActorRef | supervisor | Optional: The supervisor. |
string | name | Optional: The name. |
Operators
| Edit this page View Sourceoperator ==(IActorRef, TestActorRef<TActor>)
Compares a specified IActorRef to an TestActorRef<TActor> for equality.
Declaration
public static bool operator ==(IActorRef actorRef, TestActorRef<TActor> testActorRef)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | actorRef | The actor used for comparison |
TestActorRef<TActor> | testActorRef | The test actor used for comparison |
Returns
Type | Description |
---|---|
bool |
|
operator ==(TestActorRef<TActor>, IActorRef)
Compares a specified TestActorRef<TActor> to an IActorRef for equality.
Declaration
public static bool operator ==(TestActorRef<TActor> testActorRef, IActorRef actorRef)
Parameters
Type | Name | Description |
---|---|---|
TestActorRef<TActor> | testActorRef | The test actor used for comparison |
IActorRef | actorRef | The actor used for comparison |
Returns
Type | Description |
---|---|
bool |
|
operator !=(IActorRef, TestActorRef<TActor>)
Compares a specified IActorRef to an TestActorRef<TActor> for inequality.
Declaration
public static bool operator !=(IActorRef actorRef, TestActorRef<TActor> testActorRef)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | actorRef | The actor used for comparison |
TestActorRef<TActor> | testActorRef | The test actor used for comparison |
Returns
Type | Description |
---|---|
bool |
|
operator !=(TestActorRef<TActor>, IActorRef)
Compares a specified TestActorRef<TActor> to an IActorRef for inequality.
Declaration
public static bool operator !=(TestActorRef<TActor> testActorRef, IActorRef actorRef)
Parameters
Type | Name | Description |
---|---|---|
TestActorRef<TActor> | testActorRef | The test actor used for comparison |
IActorRef | actorRef | The actor used for comparison |
Returns
Type | Description |
---|---|
bool |
|