コード例 #1
0
        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);
          
        }
コード例 #2
0
        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();
 }
コード例 #4
0
 public void Visit(RawBlockTag rawBlockTag)
 {
     AppendTextToCurrentAccumulator(rawBlockTag.Value);
 }