Example #1
0
 public ChannelWriter(IHttpRequest connectivity, IServerEventWriter writer, ITopicChannelCache cache, IChannelInitializer <T> channelInitializer)
 {
     _connectivity       = connectivity;
     _writer             = writer;
     _cache              = cache;
     _channelInitializer = channelInitializer;
 }
        public void SetUp()
        {
            theInitializer = new DefaultChannelInitializer <FakeTopic>();
            theWriter      = new RecordingServerEventWriter();

            theCache = MockRepository.GenerateMock <ITopicChannelCache>();
            ITopicChannel <FakeTopic> channel = new TopicChannel <FakeTopic>(new EventQueue <FakeTopic>());

            theChannel = channel.Channel;
            theTopic   = new FakeTopic();

            theCache.Stub(x => x.TryGetChannelFor(theTopic, out channel)).Return(true).OutRef(channel);

            theChannelWriter = new ChannelWriter <FakeTopic>(theWriter, theWriter, theCache, theInitializer);

            e1 = new ServerEvent("1", "data-1");
            e2 = new ServerEvent("2", "data-2");
            e3 = new ServerEvent("3", "data-3");
            e4 = new ServerEvent("4", "data-4");
            e5 = new ServerEvent("5", "data-5");

            ie1 = new ServerEvent("random1", "initialization data-1");
            ie2 = new ServerEvent("random2", "initialization data-2");
            ie3 = new ServerEvent("3", "initialization data-3");
        }
Example #3
0
 public EventPublisher(ITopicChannelCache cache)
 {
     _cache = cache;
 }