public void A_supervisor_hierarchy_must_resume_children_after_Resume()
{
//Build this hierarchy:
// boss
// |
// middle
// |
// worker
var boss = ActorOf<Resumer>("resumer");
boss.Tell("spawn:middle");
var middle = ExpectMsg<IActorRef>();
middle.Tell("spawn:worker");
var worker = ExpectMsg<IActorRef>();
//Check everything is in place by sending ping to worker and expect it to respond with pong
worker.Tell("ping");
ExpectMsg("pong");
EventFilter.Warning("expected").ExpectOne(() => //expected exception is thrown by the boss when it crashes
{
middle.Tell("fail"); //Throws an exception, and then it's resumed
});
//verify that middle answers
middle.Tell("ping");
ExpectMsg("pong");
//verify worker (child to middle) is up
worker.Tell("ping");
ExpectMsg("pong");
}
[Fact]