Exemplo n.º 1
0
        internal void AddText(string text)
        {
            var textTemplateElement = new TextTemplateElement(text);

            if (_blocks.Any())
            {
                _blocks.Peek().AddInner(textTemplateElement);
                return;
            }

            _elements.Add(textTemplateElement);
        }
Exemplo n.º 2
0
        public void EvalText_GetResult_return_text()
        {
            var model             = new Model(null);
            var templateEvaluator = new TemplateEvaluator(model);

            var element = new TextTemplateElement("123");

            templateEvaluator.EvalText(element);

            string result = templateEvaluator.GetResult();

            Assert.AreEqual("123", result);
        }
 internal void EvalText(TextTemplateElement element)
 {
     _result.Append(element.Text);
 }