public void WhenInsertAfterStep_TheProcessCallsTheNewStep() { var pipeline = new MockPipeline(); var newStep = new MockStep(); pipeline.InsertAfter <MockStep>(newStep); pipeline.Process(new TestableBundle("~"), new CassetteSettings()); newStep.ProcessCalled.ShouldBeTrue(); }
public void WhenReplaceStep_ThenProcessDoesNotCallOldStep() { var pipeline = new MockPipeline(); var newStep = new MockStep(); pipeline.Replace <MockStep>(newStep); pipeline.Process(new TestableBundle("~"), new CassetteSettings()); pipeline.DummyStep.ProcessCalled.ShouldBeFalse(); }
public void WhenReplaceStep_ThenProcessCallsNewStep() { var pipeline = new MockPipeline(); var newStep = new MockStep(); pipeline.Replace <MockStep>(newStep); pipeline.Process(new TestableBundle("~"), new CassetteSettings()); newStep.ProcessCalled.ShouldBeTrue(); }
public void WhenAppendStep_ThenProcessCallsTheStepLast() { var pipeline = new MockPipeline(); var step = new MockStep(); pipeline.Append(step); pipeline.Process(new TestableBundle("~"), new CassetteSettings()); (step.CallIndex > pipeline.DummyStep.CallIndex).ShouldBeTrue(); }
public void WhenInsertBeforeStep_TheProcessCallsTheNewStepBeforeOriginalStep() { var pipeline = new MockPipeline(); var newStep = new MockStep(); pipeline.InsertBefore <MockStep>(newStep); pipeline.Process(new TestableBundle("~"), new CassetteSettings()); (newStep.CallIndex < pipeline.DummyStep.CallIndex).ShouldBeTrue(); }
public void CanChainModifications() { var pipeline = new MockPipeline(); var step1 = new MockStep(); var step2 = new MockStep(); pipeline.Append(step1).Append(step2); pipeline.Process(new TestableBundle("~"), new CassetteSettings()); step1.CallIndex.ShouldEqual(1); step2.CallIndex.ShouldEqual(2); }