Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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");
        }