Akka.Streams.Tests.Dsl.FlowConcatAllSpec.ConcatAll_must_on_cancellation_cancel_the_current_open_substream_and_the_master_stream C# (CSharp) Method

ConcatAll_must_on_cancellation_cancel_the_current_open_substream_and_the_master_stream() private method

        public void ConcatAll_must_on_cancellation_cancel_the_current_open_substream_and_the_master_stream()
        {
            this.AssertAllStagesStopped(() =>
            {
                var publisher = TestPublisher.CreateManualProbe<Source<int, NotUsed>>(this);
                var subscriber = TestSubscriber.CreateManualProbe<int>(this);
                Source.FromPublisher(publisher)
                    .ConcatMany(x => x)
                    .To(Sink.FromSubscriber(subscriber))
                    .Run(Materializer);

                var upstream = publisher.ExpectSubscription();
                var downstream = subscriber.ExpectSubscription();
                downstream.Request(1000);

                var substreamPublisher = TestPublisher.CreateManualProbe<int>(this);
                var substreamFlow = Source.FromPublisher(substreamPublisher);
                upstream.ExpectRequest();
                upstream.SendNext(substreamFlow);
                var subUpstream = substreamPublisher.ExpectSubscription();

                downstream.Cancel();

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