Akka.Tests.Actor.DeathWatchSpec.DeathWatch_must_notify_with_current_monitors_with_one_Terminated_message_when_Actor_is_stopped C# (CSharp) Метод

DeathWatch_must_notify_with_current_monitors_with_one_Terminated_message_when_Actor_is_stopped() приватный Метод

        public void DeathWatch_must_notify_with_current_monitors_with_one_Terminated_message_when_Actor_is_stopped()
        {
            var monitor1 = StartWatching(_terminal);
            var monitor2 = Sys.ActorOf(Props.Create(() => new WatchAndUnwatchMonitor(_terminal, TestActor)).WithDeploy(Deploy.Local));
            var monitor3 = StartWatching(_terminal);

            monitor2.Tell("ping");
            ExpectMsg("pong");      // since Watch and Unwatch are asynchronous, we need some sync

            _terminal.Tell(PoisonPill.Instance);

            ExpectTerminationOf(_terminal);
            ExpectTerminationOf(_terminal);

            Sys.Stop(monitor1);
            Sys.Stop(monitor2);
            Sys.Stop(monitor3);
        }