public void Walk_ChildNode_ThrowsInvalidChildNodeException() { string codeSnippet = "1+1"; var node = new HamlNodeEval(new HamlLine(codeSnippet, HamlRuleEnum.PlainText, "", -1)); node.AddChild(new HamlNodeTextContainer(0, "")); Assert.Throws <HamlInvalidChildNodeException>(() => _walker.Walk(node)); }
public void Walk_ValidNode_CallsAppendCodeToStringMethod() { string codeSnippet = "1+1"; var node = new HamlNodeEval(new HamlLine(codeSnippet, HamlRuleEnum.PlainText, "", -1)); _walker.Walk(node); _classBuilderMock.Verify(x => x.AppendCodeToString(codeSnippet)); }
private void Walk(HamlNodeEval node) { _codeClassBuilder.PrintExpressionResult(node.Content); }