Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 private void Walk(HamlNodeEval node)
 {
     _codeClassBuilder.PrintExpressionResult(node.Content);
 }