public void CanReplaySingleCommand() { var protocol = CreateTestProbe(); var flightRecorder = ActorOf(FlightRecorder.Props(protocol)); flightRecorder.Tell(new PrinterCommand(1, "G0"), protocol.Ref); flightRecorder.Tell(new ReplayCommands(1), protocol.Ref); protocol.AwaitAssert(() => protocol.ExpectMsg <ResendCommand>()); }
public void CanReplayMultipleCommands() { var protocol = CreateTestProbe(); var flightRecorder = ActorOf(FlightRecorder.Props(protocol)); flightRecorder.Tell(new PrinterCommand(1, "G0"), protocol.Ref); flightRecorder.Tell(new PrinterCommand(2, "G0"), protocol.Ref); flightRecorder.Tell(new ReplayCommands(1), protocol.Ref); protocol.AwaitAssert(() => protocol.ExpectMsg <ResendCommand>(x => x.Command.LineNumber == 1)); protocol.AwaitAssert(() => protocol.ExpectMsg <ResendCommand>(x => x.Command.LineNumber == 2)); }