예제 #1
0
        public void ShouldReturnActionsWhenMoreThanOneNodeMatch()
        {
            Tag currentTag        = new Tag("currentTag");
            var applicableAction1 = new StubElementTransformerAction();
            var applicableAction2 = new StubElementTransformerAction();

            GivenATagAndAction(currentTag, applicableAction1);
            GivenATagAndAction(currentTag, applicableAction2);
            WhenActionsRequestedFor(currentTag);
            ReturnedActionsShouldbe(applicableAction1, applicableAction2);
        }
예제 #2
0
        public void ShouldBuildInstanceWithGivenActions()
        {
            var action1 = new StubElementTransformerAction();
            var action2 = new StubElementTransformerAction();

            GivenATarget();
            GivenAction(action1);
            GivenAction(action2);
            WhenBuilt();
            ResultShouldHaveActions(action1, action2);
        }
예제 #3
0
        public void ShouldReturnActionsWhenOnlyOneTagMatch()
        {
            Tag currentTag        = new Tag("current");
            Tag anotherTag        = new Tag("foobar123");
            var applicableAction1 = new StubElementTransformerAction();
            var applicableAction2 = new StubElementTransformerAction();

            GivenATagAndAction(currentTag, applicableAction1, applicableAction2);
            GivenATagAndAction(anotherTag, new StubElementTransformerAction(), new StubElementTransformerAction());
            WhenActionsRequestedFor(currentTag);
            ReturnedActionsShouldbe(applicableAction1, applicableAction2);
        }
예제 #4
0
        public void ShouldPlaceFinalElementTransformtionsAtEndOfList()
        {
            Tag currentTag        = new Tag("currentTag");
            var applicableAction1 = new StubElementTransformerAction();
            var applicableAction2 = new StubElementTransformerAction();
            var finalAction1      = new StubElementTransformerAction();
            var finalAction2      = new StubElementTransformerAction();

            GivenATagActionAndFinal(currentTag, new[] { applicableAction1 }, new[] { finalAction1 });
            GivenATagActionAndFinal(currentTag, new[] { applicableAction2 }, new[] { finalAction2 });
            WhenActionsRequestedFor(currentTag);
            ReturnedActionsShouldbe(applicableAction1, applicableAction2, finalAction1, finalAction2);
        }
예제 #5
0
        public void ResultShouldNotHaveSameReferenceAsOriginal()
        {
            var action1 = new StubElementTransformerAction();
            var action2 = new StubElementTransformerAction();
            var action3 = new StubElementTransformerAction();

            GivenATarget();
            GivenAction(action1);
            GivenAction(action2);
            GivenAFinalAction(action3);
            WhenBuilt();
            ResultShouldNotBeReferenceEqualToTheOriginal();
        }
예제 #6
0
 private void GivenAFinalAction(StubElementTransformerAction elementTransformerAction)
 {
     Context.Target.AddFinalAction(elementTransformerAction);
 }