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"); }
/// <summary> /// /// </summary> /// <param name="enumValue"></param> /// <returns></returns> public static string LocalizeString(this Enum enumValue) { return(EnumSynonymProvider.Get(enumValue)); }
/// <summary> /// Response error model /// </summary> /// <param name="errorEnum">Error enum</param> public ResponseError(Enum errorEnum) { ErrorCode = (int)(object)errorEnum; ErrorMessage = EnumSynonymProvider.Get(errorEnum); }