Actress.Tests.MailboxProcessorTests.Receive_PostAndReply2 C# (CSharp) Method

Receive_PostAndReply2() private method

private Receive_PostAndReply2 ( ) : void
return void
        public void Receive_PostAndReply2()
        {
            // Given
            var mb = MailboxProcessor.Start<IReplyChannel<int?>>(async inbox =>
            {
                var msg = await inbox.Receive();
                msg.Reply(100);

                var msg2 = await inbox.Receive();
                msg2.Reply(200);
            });

            // When
            var result1 = mb.PostAndReply<int?>(channel => channel);
            var result2 = mb.PostAndReply<int?>(channel => channel);

            // Then
            Assert.Equal(100, result1);
            Assert.Equal(200, result2);
        }