public void AddCodeNodeShouldReturnConditionNodeWrapped() { AttributeNode attributeNode = SparkTestNodes.BasicAttributeNode("attribute"); GivenAnAttribute(attributeNode); WhenACodeExpressionNodeIsAdded(); CodeExpressionResultShouldWrap(attributeNode.Nodes.Last()); }
public void RemoveAttributeShouldRemoveFromTheWrappedNode() { AttributeNode attributeNode = SparkTestNodes.BasicAttributeNode("fred"); GivenAnOriginalElement(SparkTestNodes.ElementNode("foo").WithAttribute(attributeNode)); WhenAttributeIsRemoved(new SparkAttributeWrapper(attributeNode)); ThenTheElementShouldNotContainAttribute(attributeNode); }
public void ShouldReturnWrappedAttributeNodeIfItExists() { AttributeNode attributeNode = SparkTestNodes.BasicAttributeNode("thisAttribute"); ElementNode node = SparkTestNodes.BasicElementNode().WithAttribute(attributeNode); GivenAnOriginalElement(node); WhenAttributeIsRetreived("thisAttribute"); ThenRetrievedAttributeShouldWrap(attributeNode); }
public void NameShouldReturnTheNameOfTheWrappedNode() { GivenAnAttribute(SparkTestNodes.BasicAttributeNode("foo")); ThenNodeNameShouldBe("foo"); }
public void ExistsShouldBeTrueIfWrapperInitialisedWithNonNullAttribute() { GivenAnAttribute(SparkTestNodes.BasicAttributeNode("attrib")); WhenAskedIfItExists(); ExistsShouldBe(true); }
public void GetTextValueShouldReturnTextvalueOfWrappedAttribute() { GivenAnAttribute(SparkTestNodes.BasicAttributeNode("attribute").WithText("foo")); WhenGetTextCalled(); ThenGetTextResultShouldEqual("foo"); }
public void AddCodeNodeAddsANewConditionNodeToTheAttributeBody() { GivenAnAttribute(SparkTestNodes.BasicAttributeNode("attribute")); WhenACodeExpressionNodeIsAdded(); ThenTheAttributeShouldContainACodeExpressionNode(); }