Exemplo n.º 1
0
        public void Constructor_NormalUse_PopulatesCommentTextProperty()
        {
            string comment = "Test comment";

            var node = new HamlNodeHtmlComment(new HamlLine(comment, HamlRuleEnum.HtmlComment, new HamlSourceFileMetrics(0, 0, 0, 0), indent: ""));
            Assert.That(node.Content, Is.EqualTo(comment));
        }
Exemplo n.º 2
0
        public void Constructor_NormalUse_PopulatesCommentTextProperty()
        {
            string comment = "Test comment";

            var node = new HamlNodeHtmlComment(new HamlLine(comment, HamlRuleEnum.HtmlComment, "", 0));

            Assert.That(node.Content, Is.EqualTo(comment));
        }
        public void Walk_ValidNode_AppendsCorrectOutput()
        {
            // Arrange
            string comment = "Comment";
            var node = new HamlNodeHtmlComment(new HamlLine(comment, HamlRuleEnum.HtmlComment, indent: ""));

            // Act
            _walker.Walk(node);

            // Assert
            Assert.That(_classBuilderMock.Build(""), Is.EqualTo("<!--" + comment + " -->"));
        }
Exemplo n.º 4
0
        public void Walk_ValidNode_AppendsCorrectOutput()
        {
            // Arrange
            string comment = "Comment";
            var    node    = new HamlNodeHtmlComment(new HamlLine(comment, HamlRuleEnum.HtmlComment, "", 0));

            // Act
            _walker.Walk(node);

            // Assert
            Assert.That(_classBuilderMock.Build(""), Is.EqualTo("<!--" + comment + " -->"));
        }
        public void Walk_NestedTags_AppendsCorrectTags()
        {
            // Arrange
            HamlLine nestedText = new HamlLine("Hello world", HamlRuleEnum.PlainText, indent: "  ", isInline: true);
            var tagNode = new HamlNodeHtmlComment(new HamlLine("", HamlRuleEnum.HtmlComment, indent: ""));
            tagNode.AddChild(new HamlNodeTextContainer(nestedText));

            // Act
            _walker.Walk(tagNode);

            // Assert
            string expectedComment = "<!--" + nestedText.Indent + nestedText.Content + " -->";
            Assert.That(_classBuilderMock.Build(""), Is.EqualTo(expectedComment));
        }
Exemplo n.º 6
0
        public void Walk_NestedTags_AppendsCorrectTags()
        {
            // Arrange
            HamlLine nestedText = new HamlLine("Hello world", HamlRuleEnum.PlainText, "  ", 0, true);
            var      tagNode    = new HamlNodeHtmlComment(new HamlLine("", HamlRuleEnum.HtmlComment, "", 0));

            tagNode.AddChild(new HamlNodeTextContainer(nestedText));

            // Act
            _walker.Walk(tagNode);

            // Assert
            string expectedComment = "<!--" + nestedText.Indent + nestedText.Content + " -->";

            Assert.That(_classBuilderMock.Build(""), Is.EqualTo(expectedComment));
        }