public void WalkChildren_TextNode_WalksTextNode() { const string testText = "Hello world"; var document = new HamlDocument { new HamlNodeText(new HamlLine(testText)) }; _walker.Walk(document); Assert.That(_classBuilderMock.Build(""), Is.StringContaining(testText)); }
public void WalkChildren_TagNode_WalksTagNode() { const string tagName = "div"; var document = new HamlDocument { new HamlNodeTag(new HamlLine(tagName)) }; _walker.Walk(document); Assert.That(_classBuilderMock.Build(""), Is.StringContaining(tagName)); }
public HamlDocument ParseHamlFile(HamlFile hamlFile) { var result = new HamlDocument(); ParseNode(result, hamlFile); return result; }
public void WalkChildren_HtmlCommentNode_WalksHtmlCommentNode() { const string comment = "test"; var document = new HamlDocument { new HamlNodeHtmlComment(new HamlLine(comment)) }; _walker.Walk(document); Assert.That(_classBuilderMock.Build(""), Is.StringContaining(comment)); }
public void Walk_TextNode_AppendsCorrectTag() { // Arrange var content = new HamlLine("Simple content"); var document = new HamlDocument { new HamlNodeText(content) }; // Act var builder = new ClassBuilderMock(); new HamlDocumentWalker(builder).Walk(document, ""); // Assert Assert.That(builder.Build(""), Is.EqualTo(content.Content)); }