public void Pipe_Execution_Sequential_SubPipe_Cache() { var executor1 = new TestExecutor1(); var executor2 = new TestExecutor2(); var executor3 = new TestExecutor3(); var testSubPipe = new TestSubPipe(); var model = new TestModel { Id = 0, Name = "model 1", Milliseconds = 2000 }; Pipe <TestModel, TestResult> testPipe = new TestPipe(); testPipe .UseLocalCache() .UseStopWatch() .AsSequential() .AddExecutor(executor1) .AddExecutor(executor2) .AddExecutor(executor3) .AddExecutor(testSubPipe) .Finish(); var result = testPipe.Execute(model); Assert.True(testPipe.Elapsed.TotalMilliseconds > 12000); Assert.True(model.Id == 6); Assert.True(result.Value.Value.Id == 33); Assert.True(result.Value.Value.Text == "first cache object"); }
public void Pipe_Execution_Sequential_SubPipe_Skip() { var executor1 = new TestExecutor1(); var executor2 = new TestExecutor2(); var executor3 = new TestExecutor3(); //var pipeExecutor = new TestPipeExecutor(); var testSubPipe = new TestSubPipe(); var model = new TestModel { Id = 0, Name = "model 1", Milliseconds = 2000 }; Pipe <TestModel, TestResult> testPipe = new TestPipe(); testPipe .UseStopWatch() .AsSequential() .AddExecutor(executor1) .AddExecutor(executor2) .AddExecutor(executor3) .AddExecutor(testSubPipe, false) .Finish(); var result = testPipe.Execute(model); Assert.True(testPipe.Elapsed.TotalMilliseconds < 7000); Assert.True(model.Id == 3); }