public void Walk_ValidNode_DoesNotGenerateContent() { var node = new HamlNodeCode(new HamlLine("1+1", HamlRuleEnum.Code, "", -1)); var classBuilder = new ClassBuilderMock(); var walker = new HamlNodeCodeWalker(classBuilder, new HamlHtmlOptions()); walker.Walk(node); Assert.That(classBuilder.Build(""), Is.EqualTo("")); }
public void Walk_ConditionalWithChildNode_RendersChildNode() { const string dummyText = "Hello"; var node = new HamlNodeCode(new HamlLine("if (true)", HamlRuleEnum.Code, "", -1)); node.AddChild(new HamlNodeTextContainer(0, dummyText)); var classBuilder = new ClassBuilderMock(); var walker = new HamlNodeCodeWalker(classBuilder, new HamlHtmlOptions()); walker.Walk(node); Assert.That(classBuilder.Build(""), Is.EqualTo(dummyText)); }
public void Setup() { _classBuilderMock = new Mock <ITemplateClassBuilder>(); _walker = new HamlNodeCodeWalker(_classBuilderMock.Object, new HamlHtmlOptions()); }