Akka.Streams.Tests.Dsl.FlowThrottleSpec.Throttle_for_single_cost_elements_must_not_send_downstream_if_upstream_does_not_emit_element C# (CSharp) Метод

Throttle_for_single_cost_elements_must_not_send_downstream_if_upstream_does_not_emit_element() приватный Метод

        public void Throttle_for_single_cost_elements_must_not_send_downstream_if_upstream_does_not_emit_element()
        {
            this.AssertAllStagesStopped(() =>
            {
                var upstream = TestPublisher.CreateProbe<int>(this);
                var downstream = TestSubscriber.CreateProbe<int>(this);

                Source.FromPublisher(upstream)
                    .Throttle(1, TimeSpan.FromMilliseconds(300), 0, ThrottleMode.Shaping)
                    .RunWith(Sink.FromSubscriber(downstream), Materializer);

                downstream.Request(2);
                upstream.SendNext(1);
                downstream.ExpectNext(1);

                downstream.ExpectNoMsg(TimeSpan.FromMilliseconds(300));
                upstream.SendNext(2);
                downstream.ExpectNext(2);

                upstream.SendComplete();
                downstream.ExpectComplete();
            }, Materializer);
        }
FlowThrottleSpec