示例#1
0
        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);
        }
示例#4
0
 public void NameShouldReturnTheNameOfTheWrappedNode()
 {
     GivenAnAttribute(SparkTestNodes.BasicAttributeNode("foo"));
     ThenNodeNameShouldBe("foo");
 }
示例#5
0
 public void ExistsShouldBeTrueIfWrapperInitialisedWithNonNullAttribute()
 {
     GivenAnAttribute(SparkTestNodes.BasicAttributeNode("attrib"));
     WhenAskedIfItExists();
     ExistsShouldBe(true);
 }
示例#6
0
 public void GetTextValueShouldReturnTextvalueOfWrappedAttribute()
 {
     GivenAnAttribute(SparkTestNodes.BasicAttributeNode("attribute").WithText("foo"));
     WhenGetTextCalled();
     ThenGetTextResultShouldEqual("foo");
 }
示例#7
0
 public void AddCodeNodeAddsANewConditionNodeToTheAttributeBody()
 {
     GivenAnAttribute(SparkTestNodes.BasicAttributeNode("attribute"));
     WhenACodeExpressionNodeIsAdded();
     ThenTheAttributeShouldContainACodeExpressionNode();
 }