コード例 #1
0
        public void non_view_object_injected_into_mediator_correctly()
        {
            mediatorMap.Map(typeof(NotAView)).ToMediator(typeof(NotAViewMediator));
            NotAView notAView = new NotAView();

            mediatorMap.Mediate(notAView);
            Assert.That(notAView.mediatorName, Is.EqualTo("NotAViewMediator"));
        }
コード例 #2
0
        public void mediator_is_created_for_non_view_object()
        {
            mediatorMap.Map(typeof(NotAView)).ToMediator(typeof(NotAViewMediator));
            NotAView notAView = new NotAView();

            mediatorMap.Mediate(notAView);

            List <string> expectedNotifications = new List <string> {
                "NotAViewMediator"
            };

            Assert.That(expectedNotifications, Is.EqualTo(mediatorWatcher.Notifications).AsCollection);
        }