public void RegistersHandlerForMessageWithoutTag() { TestMessage.Register(this, OnTestMessage); _messageSent = false; TestMessage.SendWith("test"); TestMessage.Unregister(this, OnTestMessage); Assert.IsTrue(_messageSent); }
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); }