You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a failing test
First template (t0) created with 'CreateShadow' works OK
Second (t1) does not, renders all model values as empty
ST4.0.8
`public class Test
{
public string Name { get; set; }
public Test Parent { get; set; }
public string Title;
public decimal Age { get; set; }
public DateTime CreatedDate;
public Test()
{
Name = "name of test";
Title = "titel titel";
Age = 198.88m;
CreatedDate = DateTime.Now;
}
}
[TestMethod]
public void ReuseTemplateTest()
{
//temp\sttest is empty dir, just for test
var stg = new TemplateRawGroupDirectory("c:\\temp\\sttest", '$', '$');
var tpl = new Template(stg, "$model.Name$ $model.Title$");
var mdl = new Test { Name = "zzzyzx", Title = "mmm" };
var t0 = tpl.CreateShadow();
t0.Add("model", mdl);
var txt0 = t0.Render();
Assert.IsTrue(txt0.Contains(mdl.Title) && txt0.Contains(mdl.Name));
var t1 = tpl.CreateShadow();
t1.Add("model", mdl);
var txt1 = t1.Render();
Assert.IsTrue(txt1.Contains(mdl.Title) && txt1.Contains(mdl.Name));
}`
The text was updated successfully, but these errors were encountered:
lafar6502
changed the title
StringTemplate4 cloned templates (shadow) work only once, subsequent calls render empty values
StringTemplate4 (.Net) cloned templates (shadow) work only once, subsequent calls render empty values
May 23, 2017
Registered also as
antlr/antlrcs#72
Here is a failing test
First template (t0) created with 'CreateShadow' works OK
Second (t1) does not, renders all model values as empty
ST4.0.8
`public class Test
{
public string Name { get; set; }
public Test Parent { get; set; }
public string Title;
public decimal Age { get; set; }
public DateTime CreatedDate;
The text was updated successfully, but these errors were encountered: