public void TestAddStringItem01() { StringHelper stringHelper = StringHelperFactory.CreateStringHelper01(); string iD = "SampleID"; string textEnglish = "test1"; string textChinese = "TT"; string description = string.Empty; stringHelper.AddStringItem(iD, textEnglish, textChinese, description); //duplicate entry test stringHelper.AddStringItem(iD, textEnglish, textChinese, description); }
public void TestgetStringValue01() { StringHelper stringHelper = StringHelperFactory.CreateStringHelper01(); string iD = "SampleID"; string textEnglish = "test1"; string textChinese = "TT"; string description = string.Empty; stringHelper.AddStringItem(iD, textEnglish, textChinese, description); string defaultValue = "rrr"; string str = stringHelper.getStringValue(iD, defaultValue); //current language is chinese LanguageTypeHelper languageTypeHelper = LanguageTypeHelperFactory.CreateLanguageTypeHelper01(); LanguageType langType = LanguageType.Chinese; languageTypeHelper.SetLanaguageType(langType); //Test Procedure Call str = stringHelper.getStringValue(iD, defaultValue); //Post Condition Check Assert.AreEqual(textChinese, str); //current language is English languageTypeHelper.SetLanaguageType(LanguageType.English); //Test Procedure Call str = stringHelper.getStringValue(iD, defaultValue); //Post Condition Check Assert.AreEqual(textEnglish, str); //Id is not in string helper //Test Procedure Call str = stringHelper.getStringValue("UnknownID", defaultValue); //Post Condition Check Assert.AreEqual(defaultValue, str); }
public void TestRemoveStringItem01() { StringHelper stringHelper = StringHelperFactory.CreateStringHelper01(); string iD = "SampleID"; string textEnglish = "test1"; string textChinese = "TT"; string description = string.Empty; stringHelper.AddStringItem(iD, textEnglish, textChinese, description); stringHelper.RemoveStringItem(iD); //unknow id stringHelper.RemoveStringItem("unknowID"); }