public void TestImportTemplateFromAnotherGroupObject()
{
/*
dir1
a.st
b.st
dir2
a.st
*/
string dir1 = tmpdir;
string a = "a() ::= <<dir1 a>>\n";
string b = "b() ::= <<dir1 b>>\n";
writeFile(dir1, "a.st", a);
writeFile(dir1, "b.st", b);
string dir2 = tmpdir;
a = "a() ::= << <b()> >>\n";
writeFile(dir2, "a.st", a);
TemplateGroup group1 = new TemplateGroupDirectory(dir1);
TemplateGroup group2 = new TemplateGroupDirectory(dir2);
group2.ImportTemplates(group1);
Template st = group2.GetInstanceOf("b");
string expected = "dir1 b";
string result = st?.Render();
Assert.AreEqual(expected, result);
// do it again, but make a template ref imported template
st = group2.GetInstanceOf("a");
expected = " dir1 b ";
result = st?.Render();
Assert.AreEqual(expected, result);
}