Exemple #1
0
            public void RegistersHandlerForMessageWithoutTag()
            {
                TestMessage.Register(this, OnTestMessage);

                _messageSent = false;

                TestMessage.SendWith("test");

                TestMessage.Unregister(this, OnTestMessage);

                Assert.IsTrue(_messageSent);
            }
Exemple #2
0
            public void UnregistersHandlerForMessageWithTag()
            {
                TestMessage.Register(this, OnTestMessage, "mytag");

                _messageSent = false;

                TestMessage.SendWith("test", "mytag");

                TestMessage.Unregister(this, OnTestMessage, "mytag");

                Assert.IsTrue(_messageSent);

                _messageSent = false;

                TestMessage.SendWith("test", "mytag");

                Assert.IsFalse(_messageSent);
            }