Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    TestActorRefBase<TActor>
    TestActorRef<TActor>
    Implements
    IActorRef
    ICanTell
    IEquatable<IActorRef>
    IComparable<IActorRef>
    ISurrogated
    IComparable
    Inherited Members
    TestActorRefBase<TActor>.Receive(object, IActorRef)
    TestActorRefBase<TActor>.ReceiveAsync(object, IActorRef)
    TestActorRefBase<TActor>.Ref
    TestActorRefBase<TActor>.InternalRef
    TestActorRefBase<TActor>.UnderlyingActor
    TestActorRefBase<TActor>.Path
    TestActorRefBase<TActor>.Tell(object)
    TestActorRefBase<TActor>.Forward(object)
    TestActorRefBase<TActor>.Tell(object, IActorRef)
    TestActorRefBase<TActor>.Watch(IActorRef)
    TestActorRefBase<TActor>.Unwatch(IActorRef)
    TestActorRefBase<TActor>.ToString()
    TestActorRefBase<TActor>.Equals(object)
    TestActorRefBase<TActor>.GetHashCode()
    TestActorRefBase<TActor>.CompareTo(object)
    TestActorRefBase<TActor>.Equals(IActorRef)
    TestActorRefBase<TActor>.ToActorRef(TestActorRefBase<TActor>)
    TestActorRefBase<TActor>.SendSystemMessage(ISystemMessage, IActorRef)
    TestActorRefBase<TActor>.SendSystemMessage(ISystemMessage)
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    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 Source

    TestActorRef(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 Source

    operator ==(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

    true if both actors are equal; otherwise false

    | Edit this page View Source

    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

    true if both actors are equal; otherwise false

    | Edit this page View Source

    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

    true if both actors are not equal; otherwise false

    | Edit this page View Source

    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

    true if both actors are not equal; otherwise false

    Implements

    IActorRef
    ICanTell
    IEquatable<T>
    IComparable<T>
    ISurrogated
    IComparable

    Extension Methods

    ActorRefExtensions.GetOrElse(IActorRef, Func<IActorRef>)
    ActorRefExtensions.IsNobody(IActorRef)
    ActorRefImplicitSenderExtensions.Forward(IActorRef, object)
    ActorRefImplicitSenderExtensions.Tell(IActorRef, object)
    GracefulStopSupport.GracefulStop(IActorRef, TimeSpan)
    GracefulStopSupport.GracefulStop(IActorRef, TimeSpan, object)
    WatchAsyncSupport.WatchAsync(IActorRef, CancellationToken)
    Futures.Ask(ICanTell, object, TimeSpan?)
    Futures.Ask(ICanTell, object, TimeSpan?, CancellationToken)
    Futures.Ask(ICanTell, object, CancellationToken)
    Futures.Ask<T>(ICanTell, Func<IActorRef, object>, TimeSpan?, CancellationToken)
    Futures.Ask<T>(ICanTell, object, TimeSpan?)
    Futures.Ask<T>(ICanTell, object, TimeSpan?, CancellationToken)
    Futures.Ask<T>(ICanTell, object, CancellationToken)
    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET