Beispiel #1
0
            protected PipelineModelNode NewHandler()
            {
                var node = new PipelineModelNode {
                    Handler = Handler, Name = Name
                };

                return(node);
            }
Beispiel #2
0
        public static PipelineMutationModel AddToTail(PipelineMutationModel obj0, PipelineModelNode newNode)
        {
            var model = obj0.Clone();
            var prev  = model.Tail.Previous;

            newNode.Previous    = prev;
            newNode.Next        = model.Tail;
            prev.Next           = newNode;
            model.Tail.Previous = newNode;
            model.Length++;
            return(model);
        }
Beispiel #3
0
        public static PipelineMutationModel AddToHead(PipelineMutationModel obj0, PipelineModelNode newNode)
        {
            var model = obj0.Clone();
            var next  = model.Head.Next;

            newNode.Previous = model.Head;
            newNode.Next     = next;
            next.Previous    = newNode;
            model.Head.Next  = newNode;
            model.Length++;
            return(model);
        }
Beispiel #4
0
        public void PipelineModel_should_no_longer_detect_named_nodes_removed_from_tail()
        {
            var namedChannel = new NamedChannelHandler("TEST");
            var node         = new PipelineModelNode {
                Handler = namedChannel, Name = namedChannel.Name
            };
            var pipelineModel = PipelineMutationModel.Fresh();

            pipelineModel = AddToTail(pipelineModel, node);
            Assert.True(pipelineModel.Contains(node.Name));
            pipelineModel = RemoveTail(pipelineModel);
            Assert.False(pipelineModel.Contains(namedChannel.Name));
        }
Beispiel #5
0
        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));
        }
Beispiel #6
0
        public static PipelineMutationModel Fresh()
        {
            var head = new PipelineModelNode {
                Handler = new NamedChannelHandler("HEAD"), Name = "HEAD"
            };
            var tail = new PipelineModelNode {
                Handler = new NamedChannelHandler("TAIL"), Name = "TAIL"
            };

            head.Next     = tail;
            tail.Previous = head;
            return(new PipelineMutationModel
            {
                Length = 2,
                Head = head,
                Tail = tail,
                EventQueue = new Queue <Tuple <string, SupportedEvent> >()
            });
        }