public void TemplateSimpleTest() { var templater = new StringTemplater(); var actual = templater.Template("some text"); Assert.AreEqual("some text", actual); }
public string GetKickMessage(ISettingsStore settingsStore, string reason) { // [{AdminName}][{Date} {Time}] {Reason} var templater = new StringTemplater(); PrepareTemplate(settingsStore, reason, templater); return(templater.Template(settingsStore.KickMessageTemplate)); }
public void TemplateParametersTest() { var templater = new StringTemplater(); templater.AddParameter("Param", "value"); var actual = templater.Template("some text {Param}"); Assert.AreEqual("some text value", actual); }
public string GetBanMessage(ISettingsStore settingsStore, string reason, long minutes) { // [{AdminName}][{Date} {Time}] {Reason} var templater = new StringTemplater(); PrepareTemplate(settingsStore, reason, templater); templater.AddParameter("Minutes", minutes == 0 ? $"perm" : $"{minutes}"); return(templater.Template(settingsStore.BanMessageTemplate)); }