示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }
示例#5
0
        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();
        }
示例#6
0
        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);
        }