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 TestSetLanaguageType02() { LanguageTypeHelper languageTypeHelper = LanguageTypeHelperFactory.CreateLanguageTypeHelper01(); LanguageType langType = LanguageType.English; languageTypeHelper.SetLanaguageType(langType); }
public void TestGetCurrentLanguageType01() { LanguageTypeHelper languageTypeHelper = LanguageTypeHelperFactory.CreateLanguageTypeHelper01(); LanguageType langType = LanguageType.English; languageTypeHelper.SetLanaguageType(langType); LanguageType languageType = languageTypeHelper.GetCurrentLanguageType(); //Post Condition Check Assert.AreEqual(langType, languageType); }
public void TestSetLanaguageType01() { LanguageTypeHelper languageTypeHelper = LanguageTypeHelperFactory.CreateLanguageTypeHelper01(); LanguageType langType = LanguageType.Default; languageTypeHelper.SetLanaguageType(langType); //Post Condition Check Accessor languageTypeHelperaccessor = ReflectionAccessor.Wrap(languageTypeHelper); Assert.AreEqual(langType, languageTypeHelperaccessor.GetField("m_langType")); Accessor dateTimeFormatterAccessor = ReflectionAccessor.Wrap(DateTimeFormatter.getInstance()); Assert.AreEqual(languageTypeHelperaccessor.GetField("DateFormat_EN"), dateTimeFormatterAccessor.GetField("m_DateFormatStr")); //for chinese language langType = LanguageType.Chinese; languageTypeHelper.SetLanaguageType(langType); //Post Condition Check Assert.AreEqual(langType, languageTypeHelperaccessor.GetField("m_langType")); Assert.AreEqual(languageTypeHelperaccessor.GetField("DateFormat_CH"), dateTimeFormatterAccessor.GetField("m_DateFormatStr")); }
public void TestLanguageTypeHelperConstructor01() { LanguageTypeHelper languageTypeHelper = LanguageTypeHelperFactory.CreateLanguageTypeHelper01(); }