public void PassThrough()
        {
            var context = Substitute.For<IUpstreamContext>();
            var state = new CommandCompleted(new DispatchCommand(new FakeCommand(), 3));
            var dispatcher = new RetryingHandler(3);

            dispatcher.HandleUpstream(context, state);

            context.Received().SendUpstream(Arg.Any<CommandCompleted>());
        }
        public void FailTwo()
        {
            var context = Substitute.For<IUpstreamContext>();
            var msg = new CommandFailed(new DispatchCommand(new FakeCommand(), 1), new Exception());
            var dispatcher = new RetryingHandler(3);

            dispatcher.HandleUpstream(context, msg);

            context.Received().SendUpstream(Arg.Any<CommandFailed>());
            context.Received().SendDownstream(Arg.Any<DispatchCommand>());
            context.DidNotReceive().SendUpstream(Arg.Any<CommandAborted>());
        }