GetSingleChild() public method

public GetSingleChild ( string name ) : IInternalActorRef
name string
return IInternalActorRef
コード例 #1
0
 public void Getting_an_unknown_child_that_exists_in_extraNames_Should_return_nobody()
 {
     var props = Props.Create<GuardianActor>(new OneForOneStrategy(e => Directive.Stop));
     var rootGuardianActorRef = new RootGuardianActorRef(sys, props, _dispatcher, () => sys.Mailboxes.FromConfig(""), ActorRef.Nobody, _rootActorPath, _deadLetters, _emptyExtraNames);
     var actorRef = rootGuardianActorRef.GetSingleChild("unknown-child");
     Assert.Same(ActorRef.Nobody, actorRef);
 }
コード例 #2
0
 public void Getting_deadLetters_child_Should_return_tempContainer()
 {
     var props = Props.Create<GuardianActor>(new OneForOneStrategy(e => Directive.Stop));
     var rootGuardianActorRef = new RootGuardianActorRef(sys, props, _dispatcher, () => sys.Mailboxes.FromConfig(""), ActorRef.Nobody, _rootActorPath, _deadLetters, _emptyExtraNames);
     var actorRef = rootGuardianActorRef.GetSingleChild("deadLetters");
     Assert.Same(_deadLetters, actorRef);
 }
コード例 #3
0
 public void Getting_a_child_that_exists_in_extraNames_Should_return_the_child()
 {
     var extraNameChild = new DummyActorRef(_rootActorPath / "extra");
     var extraNames = new Dictionary<string, InternalActorRef> { { "extra", extraNameChild } };
     var props = Props.Create<GuardianActor>(new OneForOneStrategy(e => Directive.Stop));
     var rootGuardianActorRef = new RootGuardianActorRef(sys, props, _dispatcher, () => sys.Mailboxes.FromConfig(""), ActorRef.Nobody, _rootActorPath, _deadLetters, extraNames);
     var actorRef = rootGuardianActorRef.GetSingleChild("extra");
     Assert.Same(extraNameChild, actorRef);
 }
コード例 #4
0
 public void Getting_temp_child_Should_return_tempContainer()
 {
     var props = Props.Create<GuardianActor>(new OneForOneStrategy(e => Directive.Stop));
     var rootGuardianActorRef = new RootGuardianActorRef((ActorSystemImpl)Sys, props, _dispatcher, () => Sys.Mailboxes.CreateMailbox(props, null), ActorRefs.Nobody, _rootActorPath, _deadLetters, _emptyExtraNames);
     var tempContainer = new DummyActorRef(_rootActorPath / "temp");
     rootGuardianActorRef.SetTempContainer(tempContainer);
     var actorRef = rootGuardianActorRef.GetSingleChild("temp");
     Assert.Same(tempContainer, actorRef);
 }