public void Constructor_ValidAttributeStrings_AttributeCollectionContainsCorrectAttributes( string attributeString, string expectedFirstAttribute) { var tag = new HamlNodeHtmlAttributeCollection(0, attributeString); Assert.That(tag.Children.First().Content, Is.EqualTo(expectedFirstAttribute)); }
public void Constructor_ValidAttributeStrings_AttributeCollectionContainsCorrectAttributeCount( string attributeString, int expectedAttributeCount) { var tag = new HamlNodeHtmlAttributeCollection(0, attributeString); Assert.That(tag.Children.Count(), Is.EqualTo(expectedAttributeCount)); }
public void Constructor_CommaSeparatedAttributes_ParsesCorrectly( string attributeString, string expectedName, string expectedValue) { var tag = new HamlNodeHtmlAttributeCollection(0, attributeString); var firstChild = (HamlNodeHtmlAttribute)tag.Children.First(); Assert.That(firstChild.Name, Is.EqualTo(expectedName)); Assert.That(firstChild.Children.First().Content, Is.EqualTo(expectedValue)); }
public void Walk_VaryingAttributeCollections_WritesCorrectAttributes(string hamlLine, string expectedTag) { var node = new HamlNodeHtmlAttributeCollection(0, hamlLine); var builder = new ClassBuilderMock(); new HamlNodeHtmlAttributeCollectionWalker(builder, new HamlHtmlOptions()) .Walk(node); Assert.That(builder.Build(""), Is.EqualTo(expectedTag)); }