protected override LanguageForm[] GetOrderedAndFilteredForms(MultiTextBase text, string propertyName) { Field f = Template.GetField(propertyName); if (f == null) { return text.Forms; } return text.GetOrderedAndFilteredForms(f.WritingSystemIds); }
public void GetOrderedAndFilteredForms_EmptyMultiText_GivesEmptyList() { MultiTextBase x = new MultiTextBase(); LanguageForm[] forms = x.GetOrderedAndFilteredForms(new string[] { "one", "three" }); Assert.AreEqual(0, forms.Length); }
public void GetOrderedAndFilteredForms_DropsUnlistedForms() { MultiTextBase x = new MultiTextBase(); x["one"] = "1"; x["two"] = "2"; x["three"] = "3"; LanguageForm[] forms = x.GetOrderedAndFilteredForms(new string[] { "one", "three" }); Assert.AreEqual(2, forms.Length); Assert.AreEqual("1", forms[0].Form); Assert.AreEqual("3", forms[1].Form); }
public void GetOrderedAndFilteredForms_EmptyIdList_GivesEmptyList() { MultiTextBase x = new MultiTextBase(); x["one"] = "test"; Assert.AreEqual(0, x.GetOrderedAndFilteredForms(new string[] { }).Length); }