Akka.Streams.Tests.Dsl.TickSourceSpec.A_Flow_based_on_a_tick_publisher_must_be_possible_to_cancel C# (CSharp) Метод

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

private A_Flow_based_on_a_tick_publisher_must_be_possible_to_cancel ( ) : void
Результат void
        public void A_Flow_based_on_a_tick_publisher_must_be_possible_to_cancel()
        {
            this.AssertAllStagesStopped(() =>
            {
                var c = TestSubscriber.CreateManualProbe<string>(this);
                var tickSource = Source.Tick(TimeSpan.FromSeconds(1), TimeSpan.FromMilliseconds(500), "tick");
                var cancelable = tickSource.To(Sink.FromSubscriber(c)).Run(Materializer);
                var sub = c.ExpectSubscription();
                sub.Request(3);
                c.ExpectNoMsg(TimeSpan.FromMilliseconds(600));
                c.ExpectNext("tick");
                c.ExpectNoMsg(TimeSpan.FromMilliseconds(200));
                c.ExpectNext("tick");
                c.ExpectNoMsg(TimeSpan.FromMilliseconds(200));
                c.ExpectNext("tick");
                cancelable.Cancel();
                AwaitCondition(() => cancelable.IsCancellationRequested);
                sub.Request(3);
                c.ExpectComplete();
            }, Materializer);
        }
    }