public void TestLocalizationByConfigurationOtherNamingPattern() { MyNamedEnumeration enumeration = MyNamedEnumeration.Value1; string localized = LocalizedEnumConverter.ConvertValueToString(enumeration); Assert.AreEqual(Resources.MyResources2.MyNamedEnumeration_Value1, localized); }
public void TestLocalizationByConvention() { MyEnumeration enumeration = MyEnumeration.Value1; string localized = LocalizedEnumConverter.ConvertValueToString(enumeration); Assert.AreEqual(Resources.MyEnumeration.Value1, localized); }
public void TestLocalizationByConfigurationOtherAssembly() { MyLocalizedInOtherAssemblyEnumeration enumeration = MyLocalizedInOtherAssemblyEnumeration.Value1; string localized = LocalizedEnumConverter.ConvertValueToString(enumeration); Assert.AreEqual(Resources.MyFarResources.Value1, localized); }
public void TestLocalizationFlagedEnumeration() { MyFlagedEnumeration enumeration = MyFlagedEnumeration.Value1; MyFlagedEnumeration multipleValues = MyFlagedEnumeration.Value1 | MyFlagedEnumeration.Value2; string localized = LocalizedEnumConverter.ConvertValueToString(enumeration); string multipleValueLocalized = LocalizedEnumConverter.ConvertValueToString(multipleValues); Assert.AreEqual(Resources.MyResources.Value1, localized); Assert.AreEqual(string.Format("{0}, {1}", Resources.MyResources.Value1, Resources.MyResources.Value2), multipleValueLocalized); }