示例#1
0
        public void MigrateTest()
        {
            var migrateManager = new EnumSynonymMigrateManager();

            migrateManager.Migrate <TestEnumSynonymMigrator, TestEnumSynonymInfo>();

            var enSynonym = EnumSynonymProvider.Get(TestEnum.LoginOrPasswordIncorrect, CultureHelper.EnLanguage);

            Assert.AreEqual(enSynonym, "Login or password incorrect");

            var ruSynonym = EnumSynonymProvider.Get(TestEnum.LoginOrPasswordIncorrect, CultureHelper.RuLanguage);

            Assert.AreEqual(ruSynonym, "Неверный логин или пароль");

            var uzSynonym = EnumSynonymProvider.Get(TestEnum.LoginOrPasswordIncorrect, CultureHelper.UzLanguage);

            Assert.AreEqual(uzSynonym, "Foydalanuvchi nomi yoki parol noto'g'ri");
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="enumValue"></param>
 /// <returns></returns>
 public static string LocalizeString(this Enum enumValue)
 {
     return(EnumSynonymProvider.Get(enumValue));
 }
示例#3
0
 /// <summary>
 /// Response error model
 /// </summary>
 /// <param name="errorEnum">Error enum</param>
 public ResponseError(Enum errorEnum)
 {
     ErrorCode    = (int)(object)errorEnum;
     ErrorMessage = EnumSynonymProvider.Get(errorEnum);
 }