示例#1
0
        public void ShouldHandleUnregisteredMessagesOnlyOnListener()
        {
            //Given
            var message = new SecondMessage();

            _target.AddListener(_listeners.Add);

            //When
            _target.Send(message);


            //Then
            Assert.AreEqual(0, _queues.Count);
            Assert.AreEqual(0, _topics.Count);
            Assert.AreEqual(1, _listeners.Count);

            var received = _listeners[0];

            Assert.AreEqual(SerializeObject(message), SerializeObject(received));
            Assert.AreNotSame(message, received);
        }