public void Interpreter_must_work_with_a_massive_chain_of_batches_of_overflowing_to_the_heap()
{
var batch = new Batch<int, int>(0, _ => 0, i => i, (agg, i) => agg + i);
var ops = Enumerable.Range(1, ChainLength/10).Select(_ => batch)
.Cast<IGraphStageWithMaterializedValue<Shape, object>>().ToArray();
WithOneBoundedSetup<int, int>(ops, (lastEvents, upstream, downstream) =>
{
lastEvents().Should().BeEquivalentTo(new RequestOne());
var i = 0;
while (i < Repetition)
{
upstream.OnNext(1);
lastEvents().Should().BeEquivalentTo(new RequestOne());
i++;
}
});
}
}