public void A_Flow_with_SelectAsync_must_signal_error_from_MapAsync()
{
this.AssertAllStagesStopped(() =>
{
var latch = new TestLatch(1);
var c = TestSubscriber.CreateManualProbe<int>(this);
Source.From(Enumerable.Range(1, 5))
.SelectAsync(4, n =>
{
if (n == 3)
throw new TestException("err2");
return Task.Run(() =>
{
latch.Ready(TimeSpan.FromSeconds(10));
return n;
});
})
.RunWith(Sink.FromSubscriber(c), Materializer);
var sub = c.ExpectSubscription();
sub.Request(10);
c.ExpectError().Message.Should().Be("err2");
latch.CountDown();
}, Materializer);
}