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>, IInternalActorRef, IActorRef, ICanTell, IEquatable<IActorRef>, IComparable<IActorRef>, ISurrogated, IComparable, IActorRefScope where TActor : ActorBase
Type Parameters
Name | Description |
---|---|
TActor | The type of actor |
Constructors
| Improve this Doc 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
| Improve this Doc View SourceEquality(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 |
---|---|
Boolean |
|
Equality(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 |
---|---|
Boolean |
|
Inequality(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 |
---|---|
Boolean |
|
Inequality(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 |
---|---|
Boolean |
|