Akka.Streams.Tests.IO.InputStreamSinkSpec.InputStreamSink_should_successfully_read_several_chunks_at_once C# (CSharp) 메소드

InputStreamSink_should_successfully_read_several_chunks_at_once() 개인적인 메소드

        public void InputStreamSink_should_successfully_read_several_chunks_at_once()
        {
            this.AssertAllStagesStopped(() =>
            {
                var bytes = Enumerable.Range(1, 4).Select(_ => RandomByteString(4)).ToList();
                var sinkProbe = CreateTestProbe();
                var inputStream = Source.From(bytes).RunWith(TestSink(sinkProbe), _materializer);

                //need to wait while all elements arrive to sink
                bytes.ForEach(_ => sinkProbe.ExpectMsg<GraphStageMessages.Push>());

                for (var i = 0; i < 2; i++)
                {
                    var r = ReadN(inputStream, 8);
                    r.Item1.Should().Be(8);
                    r.Item2.ShouldBeEquivalentTo(bytes[i * 2].Concat(bytes[i * 2 + 1]));
                }

                inputStream.Close();
            }, _materializer);
        }