Beispiel #1
0
            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"));
            }
Beispiel #2
0
            public void ReturnsFalseWhenRegisteredWithTagButNotProvided()
            {
                var mediator  = new MessageMediator();
                var recipient = new MessageRecipient();

                mediator.Register <string>(recipient, recipient.OnMessage, "myTag");

                Assert.IsFalse(mediator.IsMessageRegistered(typeof(string)));
            }
Beispiel #3
0
            public void ReturnsArgumentNullException()
            {
                var mediator = new MessageMediator();

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => mediator.IsMessageRegistered(null));
            }
Beispiel #4
0
            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));
            }