public void CountyHasMoreThanTwoValue() { var options = new { County = new[] { "Kane", "Salt Lake", "Weber" } }; var actual = Handlebars.Render(Template, options); Assert.That(actual, Is.EqualTo("Kane, Salt Lake and Weber")); }
public string Each(string input) { return(Handlebars.Render(input, new { items = new[] { new { val = "A" }, new { val = "B" } } })); }
public void CountyHasOneValue() { var options = new { County = new[] { "Kane" } }; var actual = Handlebars.Render(Template, options); Assert.That(actual, Is.EqualTo("Kane")); }
public void WriteOperators() { ConsoleLogger logger = new ConsoleLogger(); Handlebars.HandlebarsDirectory = new HandlebarsDirectory("./Templates", logger); string fileName = "./tmp.txt"; foreach (string dataType in new string[] { "int", "uint", "ulong", "long", "decimal", "int?", "uint?", "ulong?", "decimal?", "string", "DateTime", "DateTime?" }) { string result = Handlebars.Render("operators", new { DataType = dataType }); result.SafeAppendToFile("./operators.txt"); result = Handlebars.Render("generic-operators", new { DataType = dataType }); result.SafeAppendToFile("./generic-operators.txt"); Message.PrintLine("Wrote file {0}", new FileInfo(fileName).FullName); } }
public string With(string input) { return(Handlebars.Render(input, new { item = new { val = "test" } })); }
public string Unless(string input, object value) { return(Handlebars.Render(input, new { val = value })); }
public string Escaping(string input, string value) { return(Handlebars.Render(input, new { value })); }
public string Simple(string input) { return(Handlebars.Render(input, new { value = "test" })); }