public void Throttle_for_various_cost_elements_must_handle_rate_calculation_function_exception()
{
this.AssertAllStagesStopped(() =>
{
var ex = new SystemException();
Source.From(Enumerable.Range(1, 5))
.Throttle(2, TimeSpan.FromMilliseconds(200), 0, _ => { throw ex; }, ThrottleMode.Shaping)
.Throttle(1, TimeSpan.FromMilliseconds(100), 5, ThrottleMode.Enforcing)
.RunWith(this.SinkProbe<int>(), Materializer)
.Request(5)
.ExpectError().Should().Be(ex);
}, Materializer);
}
}