public void DeviceGroupQuery_must_return_return_DeviceNotAvailable_if_device_stops_before_answering() { var sys = ActorSystem.Create("mysys"); var requester = new TestKit().CreateTestProbe(); var device1 = new TestKit().CreateTestProbe(); var device2 = new TestKit().CreateTestProbe(); var queryActor = sys.ActorOf(DeviceGroupQuery.Props( actorToDeviceId: new Dictionary <IActorRef, string> { [device1.Ref] = "device1", [device2.Ref] = "device2" }, requestId: 1, requester: requester.Ref, timeout: TimeSpan.FromSeconds(3) )); device1.ExpectMsg <ReadTemperature>(read => read.RequestId == 0); device2.ExpectMsg <ReadTemperature>(read => read.RequestId == 0); queryActor.Tell(new RespondTemperature(requestId: 0, value: 1.0), device1.Ref); device2.Tell(PoisonPill.Instance); requester.ExpectMsg <RespondAllTemperatures>(msg => msg.Temperatures["device1"].AsInstanceOf <Temperature>().Value == 1.0 && msg.Temperatures["device2"] is DeviceNotAvailable && msg.RequestId == 1); }