public void PipelineContext_Can_Redirect_Storage()
        {
            MockPipeline pipeline = TestPipelines.CreateMockProcessor1Pipeline();

            // Create our own special context and redirect to it when pipeline executes
            MockPipelineContextWithOwnStore context = new MockPipelineContextWithOwnStore(pipeline);
            pipeline.OnCreateContextCalled = () => context;

            ProcessorResult procResult = pipeline.Execute(new object[] { 4 });
            Assert.IsNotNull(procResult.Output, "Expected output array");
            Assert.AreEqual(1, procResult.Output.Length, "Output size mismatch");
            Assert.AreEqual(4.ToString(), procResult.Output[0], "Pipeline did produce expected value");

            Dictionary<ProcessorArgument, object> cache = context.Cache;
            Assert.AreEqual(2, cache.Count, "Expected 2 cached input values");
        }
        public void PipelineContext_Can_Redirect_Storage()
        {
            MockPipeline pipeline = TestPipelines.CreateMockProcessor1Pipeline();

            // Create our own special context and redirect to it when pipeline executes
            MockPipelineContextWithOwnStore context = new MockPipelineContextWithOwnStore(pipeline);

            pipeline.OnCreateContextCalled = () => context;

            ProcessorResult procResult = pipeline.Execute(new object[] { 4 });

            Assert.IsNotNull(procResult.Output, "Expected output array");
            Assert.AreEqual(1, procResult.Output.Length, "Output size mismatch");
            Assert.AreEqual(4.ToString(), procResult.Output[0], "Pipeline did produce expected value");

            Dictionary <ProcessorArgument, object> cache = context.Cache;

            Assert.AreEqual(2, cache.Count, "Expected 2 cached input values");
        }