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:
Update - possible workaround is to use TemplateGroup.CreateStringTemplateInternally(tpl.impl)
for cloning the template
have no idea if this is the correct approach
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: