Akka.Streams.Tests.Dsl.QueueSourceSpec.QueueSource_should_fail_offer_future_when_stream_is_completed C# (CSharp) Method

QueueSource_should_fail_offer_future_when_stream_is_completed() private method

        public void QueueSource_should_fail_offer_future_when_stream_is_completed()
        {
            this.AssertAllStagesStopped(() =>
            {
                var s = this.CreateManualProbe<int>();
                var queue =
                    Source.Queue<int>(1, OverflowStrategy.DropNew)
                        .To(Sink.FromSubscriber(s))
                        .Run(_materializer);
                var sub = s.ExpectSubscription();

                queue.WatchCompletionAsync().ContinueWith(t => "done").PipeTo(TestActor);
                sub.Cancel();
                ExpectMsg("done");

                queue.OfferAsync(1).ContinueWith(t => t.Exception.Should().BeOfType<IllegalStateException>());
            }, _materializer);
        }
    }