示例#1
0
        public void Given_a_stopped_Then_it_is_terminated()
        {
            var actorRef = new PromiseActorRef(A.Fake <ActorPath>(), A.Fake <IPromise <object> >(), A.Fake <ActorRef>(), A.Fake <TestActorSystem>());

            actorRef.Stop();
            actorRef.IsTerminated.Should().BeTrue();
        }
示例#2
0
        public void Given_a_stopped_When_sending_message_Then_it_is_forwarded_to_DeadLetter()
        {
            var deadLetters = A.Fake <ActorRef>();
            var actorRef    = new PromiseActorRef(A.Fake <ActorPath>(), A.Fake <IPromise <object> >(), deadLetters, A.Fake <TestActorSystem>());

            actorRef.Stop();

            var sender = A.Fake <ActorRef>();

            actorRef.Send("test", sender);
            A.CallTo(() => deadLetters.Send("test", sender)).MustHaveHappened();
        }