Class TestProbe
TestKit-based probe which allows sending, reception and reply.
Use CreateTestProbe(String) inside your test
to create new instances.
Assembly: Akka.TestKit.dll
Syntax
public class TestProbe : TestKitBase, IActorRefFactory, INoImplicitSender, IInternalActorRef, IActorRef, ICanTell, IEquatable<IActorRef>, IComparable<IActorRef>, ISurrogated, IComparable, IActorRefScope
Constructors
|
Improve this Doc
View Source
TestProbe(ActorSystem, ITestKitAssertions, String)
Declaration
public TestProbe(ActorSystem system, ITestKitAssertions assertions, string testProbeName = null)
Parameters
Properties
|
Improve this Doc
View Source
Ref
Gets the reference of this probe.
Declaration
public IActorRef Ref { get; }
Property Value
|
Improve this Doc
View Source
Sender
Gets the sender of the last message
Declaration
public IActorRef Sender { get; }
Property Value
Methods
|
Improve this Doc
View Source
ChildActorOf<T>(SupervisorStrategy, CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public IActorRef ChildActorOf<T>(SupervisorStrategy supervisorStrategy, CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOf<T>(String, SupervisorStrategy, CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public IActorRef ChildActorOf<T>(string name, SupervisorStrategy supervisorStrategy, CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOf<T>(String, CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public IActorRef ChildActorOf<T>(string name, CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOf<T>(CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public IActorRef ChildActorOf<T>(CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOfAsync<T>(SupervisorStrategy, CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public async Task<IActorRef> ChildActorOfAsync<T>(SupervisorStrategy supervisorStrategy, CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOfAsync<T>(String, SupervisorStrategy, CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public async Task<IActorRef> ChildActorOfAsync<T>(string name, SupervisorStrategy supervisorStrategy, CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOfAsync<T>(String, CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public async Task<IActorRef> ChildActorOfAsync<T>(string name, CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ChildActorOfAsync<T>(CancellationToken)
Spawns an actor as a child of this test actor, and returns the child's ActorRef.
Declaration
public async Task<IActorRef> ChildActorOfAsync<T>(CancellationToken cancellationToken = default(CancellationToken))
where T : ActorBase
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
CompareTo(Object)
Declaration
public int CompareTo(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
|
Improve this Doc
View Source
CreateTestProbe(String)
Declaration
[Obsolete("Cannot create a TestProbe from a TestProbe", true)]
public override TestProbe CreateTestProbe(string name = null)
Parameters
Type |
Name |
Description |
String |
name |
N/A
|
Returns
Overrides
Exceptions
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Overrides
|
Improve this Doc
View Source
Forward(IActorRef)
Forwards the last received message to the specified actor as if the
LastMessage was sent directly to the actor in the first place.
Declaration
public void Forward(IActorRef actor)
Parameters
Type |
Name |
Description |
IActorRef |
actor |
The actor to forward to.
|
|
Improve this Doc
View Source
Forward(IActorRef, Object)
Forwards a message to the specified actor. As sender the sender of the last message is used.
Declaration
public void Forward(IActorRef actor, object message)
Parameters
Type |
Name |
Description |
IActorRef |
actor |
The actor to forward to.
|
Object |
message |
The message.
|
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Improve this Doc
View Source
Reply(Object)
Send message to the sender of the last received message.
Declaration
public void Reply(object message)
Parameters
Type |
Name |
Description |
Object |
message |
The message.
|
|
Improve this Doc
View Source
Send(IActorRef, Object)
Send message to an actor while using the probe as the sender.
Replies will be available for inspection with all of TestKit's assertion
methods.
Declaration
public void Send(IActorRef actor, object message)
Parameters
Type |
Name |
Description |
IActorRef |
actor |
The actor.
|
Object |
message |
The message.
|
|
Improve this Doc
View Source
SendSystemMessage(ISystemMessage)
Sends a system message to the test probe
Declaration
public void SendSystemMessage(ISystemMessage message)
Parameters
|
Improve this Doc
View Source
SendSystemMessage(ISystemMessage, IActorRef)
Sends a system message to the test probe
Declaration
public void SendSystemMessage(ISystemMessage message, IActorRef sender)
Parameters
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
Explicit Interface Implementations
|
Improve this Doc
View Source
IActorRef.Path
Declaration
ActorPath IActorRef.Path { get; }
Returns
|
Improve this Doc
View Source
ICanTell.Tell(Object, IActorRef)
Declaration
void ICanTell.Tell(object message, IActorRef sender)
Parameters
|
Improve this Doc
View Source
ISurrogated.ToSurrogate(ActorSystem)
Declaration
ISurrogate ISurrogated.ToSurrogate(ActorSystem system)
Parameters
Returns
|
Improve this Doc
View Source
IComparable<IActorRef>.CompareTo(IActorRef)
Declaration
int IComparable<IActorRef>.CompareTo(IActorRef other)
Parameters
Returns
|
Improve this Doc
View Source
IEquatable<IActorRef>.Equals(IActorRef)
Declaration
bool IEquatable<IActorRef>.Equals(IActorRef other)
Parameters
Returns
Implements
Extension Methods