Class TestActorRefBase<TActor>
This is the base class for TestActorRefs
Inherited Members
Namespace: Akka.TestKit
Assembly: Akka.TestKit.dll
Syntax
public abstract class 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 SourceTestActorRefBase(ActorSystem, Props, IActorRef, string)
TBD
Declaration
protected TestActorRefBase(ActorSystem system, Props actorProps, IActorRef supervisor = null, string name = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorSystem | system | TBD |
| Props | actorProps | TBD |
| IActorRef | supervisor | TBD |
| string | name | TBD |
Properties
| Edit this page View SourceInternalRef
TBD
Declaration
protected InternalTestActorRef InternalRef { get; }
Property Value
| Type | Description |
|---|---|
| InternalTestActorRef |
Path
Gets the path of this instance
Declaration
public ActorPath Path { get; }
Property Value
| Type | Description |
|---|---|
| ActorPath |
Ref
TBD
Declaration
public IActorRef Ref { get; }
Property Value
| Type | Description |
|---|---|
| IActorRef |
UnderlyingActor
TBD
Declaration
public TActor UnderlyingActor { get; }
Property Value
| Type | Description |
|---|---|
| TActor |
Methods
| Edit this page View SourceCompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | An object to compare with this instance. |
Returns
| Type | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| int | A value that indicates the relative order of the objects being compared. The return value has these meanings:
|
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
Equals(IActorRef)
Declaration
public bool Equals(IActorRef other)
Parameters
| Type | Name | Description |
|---|---|---|
| IActorRef | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
| Edit this page View SourceForward(object)
Forwards a message to this actor. If this call is made from within an actor, the current actor will be the sender. If the call is made from a test class that is based on TestKit, TestActor will will be the sender;
Declaration
public void Forward(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message. |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
| Edit this page View SourceReceive(object, IActorRef)
Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome. Note: This method violates the actor model and could cause unpredictable behavior. For example, a Receive call to an actor could run simultaneously (2 simultaneous threads running inside the actor) with the actor's handling of a previous Tell call.
Declaration
public void Receive(object message, IActorRef sender = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message. |
| IActorRef | sender | The sender. |
ReceiveAsync(object, IActorRef)
Directly inject messages into actor ReceiveAsync behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome. Note: This method violates the actor model and could cause unpredictable behavior. For example, a Receive call to an actor could run simultaneously (2 simultaneous threads running inside the actor) with the actor's handling of a previous Tell call.
Declaration
public Task ReceiveAsync(object message, IActorRef sender = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message. |
| IActorRef | sender | The sender. |
Returns
| Type | Description |
|---|---|
| Task |
SendSystemMessage(ISystemMessage)
TBD
Declaration
public void SendSystemMessage(ISystemMessage message)
Parameters
| Type | Name | Description |
|---|---|---|
| ISystemMessage | message | TBD |
SendSystemMessage(ISystemMessage, IActorRef)
TBD
Declaration
public void SendSystemMessage(ISystemMessage message, IActorRef sender)
Parameters
| Type | Name | Description |
|---|---|---|
| ISystemMessage | message | TBD |
| IActorRef | sender | TBD |
Tell(object)
Sends a message to this actor. If this call is made from within an actor, the current actor will be the sender. If the call is made from a test class that is based on TestKit, TestActor will will be the sender; otherwise NoSender will be set as sender.
Declaration
public void Tell(object message)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message. |
Tell(object, IActorRef)
Sends a message to this actor with the specified sender.
Declaration
public void Tell(object message, IActorRef sender)
Parameters
| Type | Name | Description |
|---|---|---|
| object | message | The message. |
| IActorRef | sender | The sender |
ToActorRef(TestActorRefBase<TActor>)
TBD
Declaration
public static IActorRef ToActorRef(TestActorRefBase<TActor> actorRef)
Parameters
| Type | Name | Description |
|---|---|---|
| TestActorRefBase<TActor> | actorRef | TBD |
Returns
| Type | Description |
|---|---|
| IActorRef | TBD |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
| Edit this page View SourceUnwatch(IActorRef)
Deregisters this actor from being a death monitor of the provided ActorRef This means that this actor will not get a Terminated()-message when the provided actor is permanently terminated. Returns the same ActorRef that is provided to it, to allow for cleaner invocations.
Declaration
public void Unwatch(IActorRef subject)
Parameters
| Type | Name | Description |
|---|---|---|
| IActorRef | subject | The subject to unwatch. |
Watch(IActorRef)
Registers this actor to be a death monitor of the provided ActorRef This means that this actor will get a Terminated()-message when the provided actor is permanently terminated. Returns the same ActorRef that is provided to it, to allow for cleaner invocations.
Declaration
public void Watch(IActorRef subject)
Parameters
| Type | Name | Description |
|---|---|---|
| IActorRef | subject | The subject to watch. |
Operators
| Edit this page View Sourceoperator ==(IActorRef, TestActorRefBase<TActor>)
Compares a specified IActorRef to an TestActorRefBase<TActor> for equality.
Declaration
public static bool operator ==(IActorRef actorRef, TestActorRefBase<TActor> testActorRef)
Parameters
| Type | Name | Description |
|---|---|---|
| IActorRef | actorRef | The actor used for comparison |
| TestActorRefBase<TActor> | testActorRef | The test actor used for comparison |
Returns
| Type | Description |
|---|---|
| bool |
|
operator ==(TestActorRefBase<TActor>, IActorRef)
Compares a specified TestActorRefBase<TActor> to an IActorRef for equality.
Declaration
public static bool operator ==(TestActorRefBase<TActor> testActorRef, IActorRef actorRef)
Parameters
| Type | Name | Description |
|---|---|---|
| TestActorRefBase<TActor> | testActorRef | The test actor used for comparison |
| IActorRef | actorRef | The actor used for comparison |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(IActorRef, TestActorRefBase<TActor>)
Compares a specified IActorRef to an TestActorRefBase<TActor> for inequality.
Declaration
public static bool operator !=(IActorRef actorRef, TestActorRefBase<TActor> testActorRef)
Parameters
| Type | Name | Description |
|---|---|---|
| IActorRef | actorRef | The actor used for comparison |
| TestActorRefBase<TActor> | testActorRef | The test actor used for comparison |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(TestActorRefBase<TActor>, IActorRef)
Compares a specified TestActorRefBase<TActor> to an IActorRef for inequality.
Declaration
public static bool operator !=(TestActorRefBase<TActor> testActorRef, IActorRef actorRef)
Parameters
| Type | Name | Description |
|---|---|---|
| TestActorRefBase<TActor> | testActorRef | The test actor used for comparison |
| IActorRef | actorRef | The actor used for comparison |
Returns
| Type | Description |
|---|---|
| bool |
|
Edit this page