public void ReturnsTrueWhenRegisteredWithTag() { var mediator = new MessageMediator(); var recipient = new MessageRecipient(); mediator.Register <string>(recipient, recipient.OnMessage, "myTag"); Assert.IsTrue(mediator.IsMessageRegistered(typeof(string), "myTag")); }
public void ReturnsFalseWhenRegisteredWithTagButNotProvided() { var mediator = new MessageMediator(); var recipient = new MessageRecipient(); mediator.Register <string>(recipient, recipient.OnMessage, "myTag"); Assert.IsFalse(mediator.IsMessageRegistered(typeof(string))); }
public void ReturnsArgumentNullException() { var mediator = new MessageMediator(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => mediator.IsMessageRegistered(null)); }
public void ReturnsFalseWhenNotRegistered() { var mediator = new MessageMediator(); Assert.IsFalse(mediator.IsMessageRegistered(typeof(string))); }
public void ReturnsTrueWhenRegisteredWithAndWithoutTag() { var mediator = new MessageMediator(); var recipient = new MessageRecipient(); mediator.Register<string>(recipient, recipient.OnMessage, "myTag"); mediator.Register<string>(recipient, recipient.AnotherOnMessage); Assert.IsTrue(mediator.IsMessageRegistered(typeof(string))); }
public void ReturnsFalseWhenRegisteredWithTagButNotProvided() { var mediator = new MessageMediator(); var recipient = new MessageRecipient(); mediator.Register<string>(recipient, recipient.OnMessage, "myTag"); Assert.IsFalse(mediator.IsMessageRegistered(typeof(string))); }
public void ReturnsTrueWhenRegistered() { var mediator = new MessageMediator(); var recipient = new MessageRecipient(); mediator.Register<string>(recipient, recipient.OnMessage); Assert.IsTrue(mediator.IsMessageRegistered(typeof (string))); }
public void ReturnsFalseWhenNotRegistered() { var mediator = new MessageMediator(); Assert.IsFalse(mediator.IsMessageRegistered(typeof (string))); }
public void ReturnsArgumentNullException() { var mediator = new MessageMediator(); ExceptionTester.CallMethodAndExpectException<ArgumentNullException>(() => mediator.IsMessageRegistered(null)); }