public void TestDirectoryVariableArgUnknownSubstitution() { var variable = new DirectoryVariable(); var template = variable.ToString("UNKNOWN"); var engine = new TemplateEngine(template); engine.AddVariable(variable); var dynCtx = new Dictionary <string, object>(); engine.ToString(dynCtx); }
public void TestDirectoryVariableArgCurrentAbsoluteSubstitution() { var variable = new DirectoryVariable(); var template = variable.ToString(DirectoryVariable.ArgCurrentAbsolute); var engine = new TemplateEngine(template); engine.AddVariable(variable); var currentDir = new DirectoryInfo(PathUtil.Combine("path", "to", "base", "down", "to", "current")); var dynCtx = new Dictionary <string, object>(); dynCtx[DirectoryVariable.ContextCurrentDir] = currentDir; var str = engine.ToString(dynCtx); Console.WriteLine(string.Format("SUBSTITUTED STRING: '{0}'", str)); Assert.AreEqual(currentDir.FullName, str); }