public void QueueSink_should_fail_pull_future_when_stream_is_completed()
{
this.AssertAllStagesStopped(() =>
{
var probe = TestPublisher.CreateManualProbe<int>(this);
var queue = Source.FromPublisher(probe).RunWith(Sink.Queue<int>(), _materializer);
var sub = probe.ExpectSubscription();
queue.PullAsync().PipeTo(TestActor);
sub.SendNext(1);
ExpectMsg(new Option<int>(1));
sub.SendComplete();
var future = queue.PullAsync();
future.Wait(_pause).Should().BeTrue();
future.Result.Should().Be(Option<int>.None);
((Task)queue.PullAsync()).ContinueWith(t =>
{
t.Exception.InnerException.Should().BeOfType<IllegalStateException>();
}, TaskContinuationOptions.OnlyOnFaulted).Wait(TimeSpan.FromMilliseconds(300));
}, _materializer);
}