Akka.Streams.Tests.Dsl.FlowOnCompleteSpec.A_Flow_with_OnComplete_must_invoke_callback_after_transform_and_foreach_steps C# (CSharp) Method

A_Flow_with_OnComplete_must_invoke_callback_after_transform_and_foreach_steps() private method

        public void A_Flow_with_OnComplete_must_invoke_callback_after_transform_and_foreach_steps()
        {
            this.AssertAllStagesStopped(() =>
            {
                var onCompleteProbe = CreateTestProbe();
                var p = TestPublisher.CreateManualProbe<int>(this);
                var foreachSink = Sink.ForEach<int>(x => onCompleteProbe.Ref.Tell("foreach-" + x));
                var future = Source.FromPublisher(p).Select(x =>
                {
                    onCompleteProbe.Ref.Tell("map-" + x);
                    return x;
                }).RunWith(foreachSink, Materializer);
                future.ContinueWith(t => onCompleteProbe.Tell(t.IsCompleted ? "done" : "failure"));
                
                var proc = p.ExpectSubscription();
                proc.ExpectRequest();
                proc.SendNext(42);
                proc.SendComplete();
                onCompleteProbe.ExpectMsg("map-42");
                onCompleteProbe.ExpectMsg("foreach-42");
                onCompleteProbe.ExpectMsg("done");
            }, Materializer);
        }
    }