public void It_Should_Throw_An_Exception_When_No_Accumulator()
        {
            // Arrange
            var renderingVisitor = new RenderingVisitor(new TemplateContext());
            var rawTextNode      = new RawBlockTag("HELLO");

            // Act
            renderingVisitor.Visit(rawTextNode);
        }
        public void It_Should_Render_A_Raw_Text_Node()
        {
            // Arrange
            String       result    = "";
            const string blocktext = "HELLO";

            var renderingVisitor = new RenderingVisitor(new TemplateContext());

            renderingVisitor.PushTextAccumulator(str => result += str);

            var rawTextNode = new RawBlockTag(blocktext);

            // Act
            renderingVisitor.Visit(rawTextNode);

            // Assert
            Assert.That(result, Is.EqualTo(blocktext));
        }
示例#3
0
 public void Visit(RawBlockTag rawBlockTag)
 {
     _result += rawBlockTag.ToString();
 }
 public void Visit(RawBlockTag rawBlockTag)
 {
     AppendTextToCurrentAccumulator(rawBlockTag.Value);
 }