Esempio n. 1
0
 public void Activate(IActivationLog log, IPerfTimer timer)
 {
     _graph.ReadSettings(_services);
     OpenChannels();
     _graph.StartReceiving(_pipeline, _logger);
     ExecuteActivators();
 }
 public void Activate(IEnumerable <IPackageInfo> packages, IPackageLog log)
 {
     _graph.ReadSettings(_services);
     OpenChannels();
     _graph.StartReceiving(_pipeline);
     ExecuteActivators();
 }
        public void start_receiving()
        {
            using (var graph = new ChannelGraph())
            {
                var node1 = graph.ChannelFor <ChannelSettings>(x => x.Upstream);
                var node2 = graph.ChannelFor <ChannelSettings>(x => x.Downstream);
                var node3 = graph.ChannelFor <BusSettings>(x => x.Upstream);
                var node4 = graph.ChannelFor <BusSettings>(x => x.Downstream);

                node1.Incoming = true;
                node2.Incoming = false;
                node3.Incoming = true;
                node4.Incoming = false;

                graph.Each(x => x.Channel = new FakeChannel());

                graph.StartReceiving(MockRepository.GenerateMock <IHandlerPipeline>());

                node1.Channel.As <FakeChannel>().ReceivedCount.ShouldBeGreaterThan(0);
                node2.Channel.As <FakeChannel>().ReceivedCount.ShouldEqual(0);
                node3.Channel.As <FakeChannel>().ReceivedCount.ShouldBeGreaterThan(0);
                node4.Channel.As <FakeChannel>().ReceivedCount.ShouldEqual(0);
            }
        }
Esempio n. 4
0
        public void start_receiving()
        {
            using (var graph = new ChannelGraph())
            {
                var node1 = graph.ChannelFor<ChannelSettings>(x => x.Upstream);
                var node2 = graph.ChannelFor<ChannelSettings>(x => x.Downstream);
                var node3 = graph.ChannelFor<BusSettings>(x => x.Upstream);
                var node4 = graph.ChannelFor<BusSettings>(x => x.Downstream);

                node1.Incoming = true;
                node2.Incoming = false;
                node3.Incoming = true;
                node4.Incoming = false;

                graph.Each(x => x.Channel = new FakeChannel());

                graph.StartReceiving(MockRepository.GenerateMock<IHandlerPipeline>(), new RecordingLogger());

                node1.Channel.As<FakeChannel>().ReceivedCount.ShouldBeGreaterThan(0);
                node2.Channel.As<FakeChannel>().ReceivedCount.ShouldBe(0);
                node3.Channel.As<FakeChannel>().ReceivedCount.ShouldBeGreaterThan(0);
                node4.Channel.As<FakeChannel>().ReceivedCount.ShouldBe(0);
            }
        }
        public void start_receiving()
        {
            using (var graph = new ChannelGraph())
            {
                var node1 = graph.ChannelFor<ChannelSettings>(x => x.Upstream);
                var node2 = graph.ChannelFor<ChannelSettings>(x => x.Downstream);
                var node3 = graph.ChannelFor<BusSettings>(x => x.Upstream);
                var node4 = graph.ChannelFor<BusSettings>(x => x.Downstream);

                node1.Incoming = true;
                node2.Incoming = false;
                node3.Incoming = true;
                node4.Incoming = false;

                graph.Each(x => x.Channel = MockRepository.GenerateMock<IChannel>());

                graph.StartReceiving(MockRepository.GenerateMock<IHandlerPipeline>());

                node1.Channel.AssertWasCalled(x => x.Receive(null), x => x.IgnoreArguments());
                node2.Channel.AssertWasNotCalled(x => x.Receive(null), x => x.IgnoreArguments());
                node3.Channel.AssertWasCalled(x => x.Receive(null), x => x.IgnoreArguments());
                node4.Channel.AssertWasNotCalled(x => x.Receive(null), x => x.IgnoreArguments());

            }
        }