Akka.Streams.Tests.Dsl.FlowThrottleSpec.Throttle_for_single_cost_elements_must_burst_according_to_its_maximum_if_enough_time_passed C# (CSharp) 메소드

Throttle_for_single_cost_elements_must_burst_according_to_its_maximum_if_enough_time_passed() 개인적인 메소드

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

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

                downstream.Request(1);
                upstream.SendNext(1);
                downstream.ExpectNoMsg(TimeSpan.FromMilliseconds(100));
                downstream.ExpectNext(1);
                downstream.Request(5);
                downstream.ExpectNoMsg(TimeSpan.FromMilliseconds(1200));
                var expected = new List<OnNext>();
                for (var i = 2; i < 7; i++)
                {
                    upstream.SendNext(i);
                    expected.Add(new OnNext(i));
                }
                downstream.ReceiveWhile(TimeSpan.FromMilliseconds(300), filter: x => x, msgs: 5)
                    .ShouldAllBeEquivalentTo(expected);
                
                downstream.Cancel();
            }, Materializer);
        }
FlowThrottleSpec