Akka.Streams.Tests.Dsl.HeadSinkSpec.A_FLow_with_a_Sink_HeadOption_must_yield_the_first_value C# (CSharp) Méthode

A_FLow_with_a_Sink_HeadOption_must_yield_the_first_value() private méthode

        public void A_FLow_with_a_Sink_HeadOption_must_yield_the_first_value()
        {
            this.AssertAllStagesStopped(() =>
            {
                var p = TestPublisher.CreateManualProbe<int>(this);
                var task = Source.FromPublisher(p).Select(x => x).RunWith(Sink.FirstOrDefault<int>(), Materializer);
                var proc = p.ExpectSubscription();
                proc.ExpectRequest();
                proc.SendNext(42);
                task.Wait(100);
                task.Result.Should().Be(42);
                proc.ExpectCancellation();
            }, Materializer);
        }