public void TestPingSupervisor()
        {
            var testResults = new PingActor.PingTestResults();
            var ping        = TestWorld.ActorFor <IPing>(
                Definition.Has <PingActor>(
                    Definition.Parameters(testResults), "ping"));

            var supervisorResults = PingSupervisorActor.Instance.Value.TestResults.Get();
            var pingAccess        = testResults.AfterCompleting(5);
            var supervisorAccess  = supervisorResults.AfterCompleting(5);

            for (var idx = 0; idx < 5; ++idx)
            {
                ping.Actor.Ping();
            }

            Assert.False(ping.ActorInside.IsStopped);
            Assert.Equal(5, pingAccess.ReadFrom <int>("pingCount"));
            Assert.Equal(5, supervisorAccess.ReadFrom <int>("informedCount"));

            pingAccess       = testResults.AfterCompleting(2);
            supervisorAccess = supervisorResults.AfterCompleting(1);

            ping.Actor.Ping();

            Assert.Equal(6, pingAccess.ReadFrom <int>("pingCount"));
            Assert.Equal(6, supervisorAccess.ReadFrom <int>("informedCount"));

            Assert.True(ping.ActorInside.IsStopped);
        }
        public void TestStopAll()
        {
            var stopResults = new StopAllSupervisorResult();

            World.ActorFor <ISupervisor>(Definition.Has <StopAllSupervisorActor>(Definition.Parameters(stopResults), "stop-all"));

            var pingTestResults = new PingActor.PingTestResults();
            var ping            = World.ActorFor <IPing>(
                Definition.Has <PingActor>(
                    Definition.Parameters(pingTestResults), StopAllSupervisorActor.Instance.Value, "ping"));
            var pongTestResults = new PongActor.PongTestResults();
            var pong            = World.ActorFor <IPong>(
                Definition.Has <PongActor>(
                    Definition.Parameters(pongTestResults), StopAllSupervisorActor.Instance.Value, "pong"));

            var pingAccess = pingTestResults.AfterCompleting(1);
            var pongAccess = pongTestResults.AfterCompleting(1);
            var stopAccess = stopResults.AfterCompleting(1);

            ping.Ping();

            Assert.Equal(1, stopAccess.ReadFrom <int>("informedCount"));
            Assert.Equal(1, pingAccess.ReadFrom <int>("stopCount"));
            Assert.Equal(1, pongAccess.ReadFrom <int>("stopCount"));
        }