Akka.Streams.Tests.Dsl.FlowLimitSpec.A_Limit_must_throw_a_StreamLimitReachedException_when_n_lower_than_0 C# (CSharp) Method

A_Limit_must_throw_a_StreamLimitReachedException_when_n_lower_than_0() private method

        public void A_Limit_must_throw_a_StreamLimitReachedException_when_n_lower_than_0()
        {
            var input = Enumerable.Range(1, 6).ToList();
            var n = -1; // n < input.Count
            var future = Source.From(input)
                .Limit(n)
                .Grouped(1000)
                .RunWith(Sink.First<IEnumerable<int>>(), Materializer);

            future.Invoking(f => f.Wait(TimeSpan.FromMilliseconds(300))).ShouldThrow<StreamLimitReachedException>();
        }
    }