Akka.Cluster.Sharding.Tests.ClusterShardingGracefulShutdownSpec.ClusterSharding_should_gracefully_shutdown_a_region C# (CSharp) Method

ClusterSharding_should_gracefully_shutdown_a_region() private method

        public void ClusterSharding_should_gracefully_shutdown_a_region()
        {
            ClusterSharding_should_start_some_shards_in_both_regions();

            RunOn(() =>
            {
                _region.Value.Tell(GracefulShutdown.Instance);
            }, _second);

            RunOn(() =>
            {
                var probe = CreateTestProbe();
                for (int i = 1; i <= 200; i++)
                {
                    _region.Value.Tell(i, probe.Ref);
                    probe.ExpectMsg(i, TimeSpan.FromSeconds(1));
                    Assert.Equal(_region.Value.Path / i.ToString() / i.ToString(), probe.LastSender.Path);
                }
            }, _first);
            EnterBarrier("handoff-completed");

            RunOn(() =>
            {
                var region = _region.Value;
                Watch(region);
                ExpectTerminated(region);
            }, _second);
            EnterBarrier("after-3");
        }
    }