예제 #1
0
        public void GetNextUnresolvedPartial_Partials_ReturnsPartial()
        {
            var partial = new HamlNodePartial(new HamlLine("", HamlRuleEnum.Partial, new HamlSourceFileMetrics(-1, 0, 0, 0), ""));
            var rootNode = new HamlNodeDummy();
            rootNode.AddChild(partial);

            var result = rootNode.GetNextUnresolvedPartial();
            Assert.That(result, Is.EqualTo(partial));
        }
예제 #2
0
        public void GetNextUnresolvedPartial_PartialIsAGrandchildNode_ReturnsPartial()
        {
            var textContainerNode = new HamlNodeTextContainer(0, "Test content");
            var partial = new HamlNodePartial(new HamlLine("", HamlRuleEnum.Partial, "", -1));
            textContainerNode.AddChild(partial);

            var rootNode = new HamlNodeDummy();
            rootNode.AddChild(textContainerNode);

            var result = rootNode.GetNextUnresolvedPartial();
            Assert.That(result, Is.EqualTo(partial));
        }
예제 #3
0
        public void GetNextUnresolvedPartial_OneResolvedAndOneUnresolvedPartial_ReturnsCorrectPartial()
        {
            var resolvedPartial = new HamlNodePartial(new HamlLine("", HamlRuleEnum.Partial, new HamlSourceFileMetrics(-1, 0, 0, 0), indent: ""));
            resolvedPartial.SetDocument(HamlDocumentBuilder.Create());

            var unresolvedPartial = new HamlNodePartial(new HamlLine("", HamlRuleEnum.Partial, new HamlSourceFileMetrics(-1, 0, 0, 0), indent: ""));

            var rootNode = new HamlNodeDummy();
            rootNode.AddChild(resolvedPartial);
            rootNode.AddChild(unresolvedPartial);

            var result = rootNode.GetNextUnresolvedPartial();
            Assert.That(result, Is.EqualTo(unresolvedPartial));
        }