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 Walk_InvalidNodeType_ThrowsInvalidCastException() { var node = new HamlNodeTextContainer(0, ""); Assert.Throws <InvalidCastException>(() => _walker.Walk(node)); }