public void execute_ordered_test3()
        {
            // arrange
            var mockPipelineDefinition = new Mock<IPipeDefinition>();
            mockPipelineDefinition.SetupGet(e => e.Operations).Returns(new[] { new Oper((a, o) => (int)o * 4), new Oper((a, o) => (int)o - 2) });
            var item = new PipelineCompiler<int, int>(mockPipelineDefinition.Object);

            var f = item.Compile(new Queue<IOperation>(new[] { new Oper((a, o) => (int)o * 4), new Oper((a, o) => (int)o - 2), new Oper((a, o) => (int)o / 3) }));

            Assert.That(f(null, 5), Is.EqualTo(6));
        }
        public void execute_reverse_ordered_test3()
        {
            // arrange
            var mockPipelineDefinition = new Mock<IPipeDefinition>();
            mockPipelineDefinition.SetupGet(e => e.Closed).Returns(true);
            mockPipelineDefinition.SetupGet(e => e.Operations).Returns(new[] { new Oper((a, o) => (int)o / 3), new Oper((a, o) => (int)o - 2), new Oper((a, o) => (int)o * 4) });
            var item = new PipelineCompiler<int, int>(mockPipelineDefinition.Object);

            // act
            var f = item.Compile();

            // assert
            Assert.That(f(null, 12), Is.EqualTo(8));
        }
        public void execute_ordered_test()
        {
            var mockPipelineDefinition = new Mock<IPipeDefinition>();
            var oper = new Oper((a, o) => (int)o * 2);
            mockPipelineDefinition.SetupGet(e => e.Closed).Returns(true);

            mockPipelineDefinition.SetupGet(e => e.Operations).Returns(new[] {oper});

            var item = new PipelineCompiler<int, int>(mockPipelineDefinition.Object);

            var f = item.Compile();

            Assert.That(f(null, 5), Is.EqualTo(10));
        }