void RunChain(params IPreprocessingStep[] initialSteps) { var steps = new Queue <IPreprocessingStep>(initialSteps); callback.When(x => x.YieldNextStep(Arg.Any <IPreprocessingStep>())).Do( callInfo => steps.Enqueue(callInfo.Arg <IPreprocessingStep>())); while (steps.Count > 0) { steps.Dequeue().Execute(callback)?.Wait(); } }