Akka.Streams.Tests.Dsl.FlowAggregateSpec.A_Aggregate_must_complete_future_with_failure_when_folding_functions_throws C# (CSharp) Méthode

A_Aggregate_must_complete_future_with_failure_when_folding_functions_throws() private méthode

        public void A_Aggregate_must_complete_future_with_failure_when_folding_functions_throws()
        {
            this.AssertAllStagesStopped(() =>
            {
                var error = new TestException("buh");
                var future = InputSource.RunAggregate(0, (x,y) =>
                {
                    if (x > 50)
                        throw error;
                    return x + y;
                }, Materializer);

                future.Invoking(f => f.Wait(TimeSpan.FromSeconds(3)))
                    .ShouldThrow<TestException>()
                    .And.Should()
                    .Be(error);
            }, Materializer);
        }
    }