Esempio n. 1
0
        public async Task EventChannel_SentMessage_IsReceivedByReiceiver()
        {
            var eventChannel = new EventChannel <object>();
            var expected     = new object();

            var task = eventChannel.SendAsync(expected);

            Assert.Equal(expected, await eventChannel.ReceiveAsync());
        }
Esempio n. 2
0
        public async Task EventChannel_Acknowledge_IsReceivedBySender()
        {
            var eventChannel = new EventChannel <object>();
            var expected     = true;

            var task = eventChannel.SendAsync(expected);

            eventChannel.Acknowledge(expected);

            Assert.Equal(expected, await task);
        }