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

ConcatAll_must_on_OnError_on_master_stream_cancel_the_currently_opening_substream_and_signal_error() private method

        public void ConcatAll_must_on_OnError_on_master_stream_cancel_the_currently_opening_substream_and_signal_error()
        {
            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, false);
                var substreamFlow = Source.FromPublisher(substreamPublisher);
                upstream.ExpectRequest();
                upstream.SendNext(substreamFlow);
                var subUpstream = substreamPublisher.ExpectSubscription();

                upstream.SendError(TestException);

                subUpstream.SendOnSubscribe();

                subscriber.ExpectError().Should().Be(TestException);
                subUpstream.ExpectCancellation();
            }, Materializer);
        }