 | TestKitBase.ActorOfAsTestActorRef<TActor> Method (Expression<Func<TActor>>, IActorRef, String) |
Create a new actor as child of the specified supervisor and returns it as
TestActorRef< TActor>
to enable access to the underlying actor instance via
UnderlyingActor.
Uses an expression that calls the constructor of
TActor.
ExamplesActorOf<MyActor>(()=>new MyActor("value", 4711), "test-actor")
Namespace:
Akka.TestKit
Assembly:
Akka.TestKit (in Akka.TestKit.dll) Version: 1.2.3.42 (1.2.3.42)
Syntaxpublic TestActorRef<TActor> ActorOfAsTestActorRef<TActor>(
Expression<Func<TActor>> factory,
IActorRef supervisor,
string name = null
)
where TActor : ActorBase
member ActorOfAsTestActorRef :
factory : Expression<Func<'TActor>> *
supervisor : IActorRef *
?name : string
(* Defaults:
let _name = defaultArg name null
*)
-> TestActorRef<'TActor> when 'TActor : ActorBase
Parameters
- factory
- Type: System.Linq.Expressions.Expression<Func<TActor>>
An expression that calls the constructor of TActor - supervisor
- Type: Akka.Actor.IActorRef
The supervisor - name (Optional)
- Type: System.String
Optional: The name.
Type Parameters
- TActor
- The type of the actor.
Return Value
Type:
TestActorRef<TActor>TBD
See Also