コード例 #1
0
        public void Publish_Message_Correctly()
        {
            _publisher.Subscribe(_handler);
            Assert.AreEqual(0, _handler.Counter);

            _publisher.Publish(new TestMessage(5));

            // Without calling Deliver, messages shouldn't be delivered.
            Assert.AreEqual(0, _handler.Counter);

            _publisher.Deliver(_messageHistory);

            Assert.AreEqual(5, _handler.Counter);
        }