public void ChannelPipeline_should_add_item_to_head()
 {
     var pipeline = new DefaultChannelPipeline(TestChannel.Instance);
     var namedChannel = new NamedChannelHandler("TEST");
     pipeline.AddFirst(namedChannel.Name, namedChannel);
     var count = pipeline.Count();
     Assert.Equal(3, count); // 1 for head, 1 for named channel, 1 for tail
 }
 public void PipelineModel_should_no_longer_detect_named_nodes_added_to_head()
 {
     var namedChannel = new NamedChannelHandler("TEST");
     var namedChannel2 = new NamedChannelHandler("TEST2");
     var node = new PipelineModelNode {Handler = namedChannel, Name = namedChannel.Name};
     var pipelineModel = PipelineMutationModel.Fresh();
     pipelineModel = AddToHead(pipelineModel, node);
     Assert.True(pipelineModel.Contains(node.Name));
     pipelineModel = RemoveHead(pipelineModel);
     Assert.False(pipelineModel.Contains(namedChannel.Name));
 }
 public void PipelineModel_should_detect_named_nodes_added_to_tail()
 {
     var namedChannel = new NamedChannelHandler("TEST");
     var namedChannel2 = new NamedChannelHandler("TEST2");
     var node = new PipelineModelNode {Handler = namedChannel, Name = namedChannel.Name};
     var pipelineModel = PipelineMutationModel.Fresh();
     pipelineModel = AddToTail(pipelineModel, node);
     Assert.True(pipelineModel.Contains(node.Name));
     var node2 = new PipelineModelNode {Handler = namedChannel2, Name = namedChannel2.Name};
     pipelineModel = AddToTail(pipelineModel, node2);
     Assert.True(pipelineModel.Contains(node.Name));
     Assert.True(pipelineModel.Contains(node2.Name));
 }
 public Property DefaultNamedChannelHandler_should_not_support_any_events(SupportedEvent[] events)
 {
     var handler = new NamedChannelHandler("foo");
     return events.All(x => !handler.SupportsEvent(x)).ToProperty();
 }