示例#1
0
        public void can_update_availability_if_node_has_handler()
        {
            var message = new FakeMessage();
            var handler = Mock <IRoutedMessageHandler>();
            var trigger = Mock <IMessageTrigger>();

            handler.Expect(x => x.Initialize(node));
            trigger.Expect(x => x.Message).Return(message);
            handler.Expect(x => x.Handles(message)).Return(true);
            handler.Expect(x => x.UpdateAvailability(trigger));

            node.RegisterHandler(handler);

            node.UpdateAvailability(trigger);
        }