public void RemoveAttributeShouldRemoveFromTheWrappedNode() { AttributeNode attributeNode = SparkTestNodes.BasicAttributeNode("fred"); GivenAnOriginalElement(SparkTestNodes.ElementNode("foo").WithAttribute(attributeNode)); WhenAttributeIsRemoved(new SparkAttributeWrapper(attributeNode)); ThenTheElementShouldNotContainAttribute(attributeNode); }
public void ClearInnerTextShouldRemoveAllTextNodesFromBody() { ElementNode node = SparkTestNodes.ElementNode("bar"); GivenAnOriginalElement(node, new TextNode("A text"), new TextNode("abc")); WhenInnerTextCleared(); ThenNodeHasNoBody(); }
public void AddCodeConditionalExpressionShouldReturnTheWrappedNode() { ElementNode node = SparkTestNodes.ElementNode("foo"); GivenAnOriginalElement(node); WhenConditionalExpressionAreAdded(); ThenAddCodeConditionalExpressionAttributeShouldWrapBodyNode(); }
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); }
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); }
public void AddCodeExpressionShouldAddNewCodeExpressionNodeToElement() { GivenAnOriginalElement(SparkTestNodes.ElementNode("foo")); WhenCodeExpressionIsAdded(); ThenTheElementShouldHaveOneCodeElementInItsChildren(); }
public void NameShouldReturnTheNameOfTheWrappedNode() { GivenAnOriginalElement(SparkTestNodes.ElementNode("foo")); ThenNodeNameShouldBe("foo"); }