コード例 #1
0
        public void RemoveAttributeShouldRemoveFromTheWrappedNode()
        {
            AttributeNode attributeNode = SparkTestNodes.BasicAttributeNode("fred");

            GivenAnOriginalElement(SparkTestNodes.ElementNode("foo").WithAttribute(attributeNode));
            WhenAttributeIsRemoved(new SparkAttributeWrapper(attributeNode));
            ThenTheElementShouldNotContainAttribute(attributeNode);
        }
コード例 #2
0
        public void ClearInnerTextShouldRemoveAllTextNodesFromBody()
        {
            ElementNode node = SparkTestNodes.ElementNode("bar");

            GivenAnOriginalElement(node, new TextNode("A text"), new TextNode("abc"));
            WhenInnerTextCleared();
            ThenNodeHasNoBody();
        }
コード例 #3
0
        public void AddCodeConditionalExpressionShouldReturnTheWrappedNode()
        {
            ElementNode node = SparkTestNodes.ElementNode("foo");

            GivenAnOriginalElement(node);
            WhenConditionalExpressionAreAdded();
            ThenAddCodeConditionalExpressionAttributeShouldWrapBodyNode();
        }
コード例 #4
0
        public void GetChildElementsShouldBeCaseSensitive()
        {
            ElementNode node      = SparkTestNodes.ElementNode("bar");
            ElementNode matching1 = SparkTestNodes.ElementNode("FOO");
            ElementNode matching2 = SparkTestNodes.ElementNode("foo");

            GivenAnOriginalElement(node, matching1, matching2);
            WhenGetChildElements("foo");
            ThenGetChildElementsResultShouldBe(matching1, matching2);
        }
コード例 #5
0
        public void GetChildElementsShouldReturnThoseWithMatchingName()
        {
            ElementNode node      = SparkTestNodes.ElementNode("bar");
            ElementNode matching1 = SparkTestNodes.ElementNode("foo");
            ElementNode matching2 = SparkTestNodes.ElementNode("foo");

            GivenAnOriginalElement(node, matching1, matching2, SparkTestNodes.ElementNode("bar2"));
            WhenGetChildElements("foo");
            ThenGetChildElementsResultShouldBe(matching1, matching2);
        }
コード例 #6
0
 public void AddCodeExpressionShouldAddNewCodeExpressionNodeToElement()
 {
     GivenAnOriginalElement(SparkTestNodes.ElementNode("foo"));
     WhenCodeExpressionIsAdded();
     ThenTheElementShouldHaveOneCodeElementInItsChildren();
 }
コード例 #7
0
 public void NameShouldReturnTheNameOfTheWrappedNode()
 {
     GivenAnOriginalElement(SparkTestNodes.ElementNode("foo"));
     ThenNodeNameShouldBe("foo");
 }