private static void FillLocalizer(Localizer loc, ITemplateSet templates) { for (Template t = templates.GetNextTemplate(); t != null; t = templates.GetNextTemplate()) { if (string.IsNullOrEmpty(t.Translation)) { loc.Remove(t.Tag); } else { loc.Add(t.Tag, t.Translation); } } }
[Test] public void GetNonEmptyTemplateSet() { ITemplateSetLoader loader = new MyTemplateSetLoader(); using (ITemplateSet templates = loader.Load("en", "Base")) Assert.AreEqual("LongText", templates.GetNextTemplate().Tag); }
[Test] public void GetEmptyTemplateSet() { ITemplateSetLoader loader = new MyTemplateSetLoader(); using (ITemplateSet templates = loader.Load("en", "Empty")) Assert.IsNull(templates.GetNextTemplate()); }
private static void FillLocalizer (Localizer loc, ITemplateSet templates) { for (Template t = templates.GetNextTemplate(); t != null; t = templates.GetNextTemplate()) { if (string.IsNullOrEmpty(t.Translation)) loc.Remove(t.Tag); else loc.Add(t.Tag, t.Translation); } }