Inheritance: UnboundedMailbox
Ejemplo n.º 1
0
        public void CleanUp_drains_queue()
        {
            using (var loggerMailbox = new LoggerMailbox())
            {
                loggerMailbox.Post(TestActor, new Envelope {Message = "foo", Sender = TestActor});

                loggerMailbox.NumberOfMessages.ShouldBe(1);

                loggerMailbox.CleanUp();

                loggerMailbox.NumberOfMessages.ShouldBe(0);
            }
        }
Ejemplo n.º 2
0
        public void CleanUp_drains_queue()
        {
            var loggerMailbox = new LoggerMailbox(ActorRefs.Nobody, Sys);
            loggerMailbox.SetActor((ActorCell)TestActor.AsInstanceOf<ActorRefWithCell>().Underlying); // mailboxes won't cleanup without an actorcell set
            loggerMailbox.Enqueue(TestActor, new Envelope("foo", TestActor));

            loggerMailbox.NumberOfMessages.ShouldBe(1);

            loggerMailbox.CleanUp();

            loggerMailbox.NumberOfMessages.ShouldBe(0);

        }