Akka.Streams.Tests.Dsl.FlowSelectAsyncSpec.A_Flow_with_SelectAsync_must_handle_cancel_properly C# (CSharp) Method

A_Flow_with_SelectAsync_must_handle_cancel_properly() private method

        public void A_Flow_with_SelectAsync_must_handle_cancel_properly()
        {
            this.AssertAllStagesStopped(() =>
            {
                var pub = TestPublisher.CreateManualProbe<int>(this);
                var sub = TestSubscriber.CreateManualProbe<int>(this);

                Source.FromPublisher(pub)
                    .SelectAsync(4, _ => Task.FromResult(0))
                    .RunWith(Sink.FromSubscriber(sub), Materializer);

                var upstream = pub.ExpectSubscription();
                upstream.ExpectRequest();

                sub.ExpectSubscription().Cancel();

                upstream.ExpectCancellation();
            }, Materializer);
        }