Table of Contents

Class TestActorRefBase<TActor>

Namespace
Akka.TestKit
Assembly
Akka.TestKit.dll

This is the base class for TestActorRefs

public abstract class TestActorRefBase<TActor> : ICanTell, IEquatable<IActorRef>, IInternalActorRef, IActorRef, IComparable<IActorRef>, ISurrogated, IComparable, IActorRefScope where TActor : ActorBase

Type Parameters

TActor

The type of actor

Inheritance
TestActorRefBase<TActor>
Implements
ICanTell
IEquatable<IActorRef>
IInternalActorRef
IActorRef
IComparable<IActorRef>
ISurrogated
IActorRefScope
Derived
Inherited Members

Constructors

TestActorRefBase(ActorSystem, Props, IActorRef, string)

TBD

protected TestActorRefBase(ActorSystem system, Props actorProps, IActorRef supervisor = null, string name = null)

Parameters

system ActorSystem

TBD

actorProps Props

TBD

supervisor IActorRef

TBD

name string

TBD

Properties

InternalRef

TBD

protected InternalTestActorRef InternalRef { get; }

Property Value

InternalTestActorRef

Path

Gets the path of this instance

public ActorPath Path { get; }

Property Value

ActorPath

Ref

TBD

public IActorRef Ref { get; }

Property Value

IActorRef

UnderlyingActor

TBD

public TActor UnderlyingActor { get; }

Property Value

TActor

Methods

CompareTo(object)

public int CompareTo(object obj)

Parameters

obj object

Returns

int

Equals(IActorRef)

public bool Equals(IActorRef other)

Parameters

other IActorRef

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Forward(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;

public void Forward(object message)

Parameters

message object

The message.

GetHashCode()

public override int GetHashCode()

Returns

int

Receive(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.

public void Receive(object message, IActorRef sender = null)

Parameters

message object

The message.

sender IActorRef

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.

public Task ReceiveAsync(object message, IActorRef sender = null)

Parameters

message object

The message.

sender IActorRef

The sender.

Returns

Task

SendSystemMessage(ISystemMessage)

TBD

public void SendSystemMessage(ISystemMessage message)

Parameters

message ISystemMessage

TBD

SendSystemMessage(ISystemMessage, IActorRef)

TBD

public void SendSystemMessage(ISystemMessage message, IActorRef sender)

Parameters

message ISystemMessage

TBD

sender IActorRef

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 Akka.Actor.ActorRefs.NoSender will be set as sender.

public void Tell(object message)

Parameters

message object

The message.

Tell(object, IActorRef)

Sends a message to this actor with the specified sender.

public void Tell(object message, IActorRef sender)

Parameters

message object

The message.

sender IActorRef

The sender

ToActorRef(TestActorRefBase<TActor>)

TBD

public static IActorRef ToActorRef(TestActorRefBase<TActor> actorRef)

Parameters

actorRef TestActorRefBase<TActor>

TBD

Returns

IActorRef

TBD

ToString()

public override string ToString()

Returns

string

Unwatch(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.

public void Unwatch(IActorRef subject)

Parameters

subject IActorRef

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.

public void Watch(IActorRef subject)

Parameters

subject IActorRef

The subject to watch.

Operators

operator ==(IActorRef, TestActorRefBase<TActor>)

Compares a specified Akka.Actor.IActorRef to an TestActorRefBase<TActor> for equality.

public static bool operator ==(IActorRef actorRef, TestActorRefBase<TActor> testActorRef)

Parameters

actorRef IActorRef

The actor used for comparison

testActorRef TestActorRefBase<TActor>

The test actor used for comparison

Returns

bool

true if both actors are equal; otherwise false

operator ==(TestActorRefBase<TActor>, IActorRef)

Compares a specified TestActorRefBase<TActor> to an Akka.Actor.IActorRef for equality.

public static bool operator ==(TestActorRefBase<TActor> testActorRef, IActorRef actorRef)

Parameters

testActorRef TestActorRefBase<TActor>

The test actor used for comparison

actorRef IActorRef

The actor used for comparison

Returns

bool

true if both actors are equal; otherwise false

operator !=(IActorRef, TestActorRefBase<TActor>)

Compares a specified Akka.Actor.IActorRef to an TestActorRefBase<TActor> for inequality.

public static bool operator !=(IActorRef actorRef, TestActorRefBase<TActor> testActorRef)

Parameters

actorRef IActorRef

The actor used for comparison

testActorRef TestActorRefBase<TActor>

The test actor used for comparison

Returns

bool

true if both actors are not equal; otherwise false

operator !=(TestActorRefBase<TActor>, IActorRef)

Compares a specified TestActorRefBase<TActor> to an Akka.Actor.IActorRef for inequality.

public static bool operator !=(TestActorRefBase<TActor> testActorRef, IActorRef actorRef)

Parameters

testActorRef TestActorRefBase<TActor>

The test actor used for comparison

actorRef IActorRef

The actor used for comparison

Returns

bool

true if both actors are not equal; otherwise false