Beispiel #1
0
        public void TestLocalizationByConfigurationOtherNamingPattern()
        {
            MyNamedEnumeration enumeration = MyNamedEnumeration.Value1;

            string localized = LocalizedEnumConverter.ConvertValueToString(enumeration);

            Assert.AreEqual(Resources.MyResources2.MyNamedEnumeration_Value1, localized);
        }
Beispiel #2
0
        public void TestLocalizationByConvention()
        {
            MyEnumeration enumeration = MyEnumeration.Value1;

            string localized = LocalizedEnumConverter.ConvertValueToString(enumeration);

            Assert.AreEqual(Resources.MyEnumeration.Value1, localized);
        }
Beispiel #3
0
        public void TestLocalizationByConfigurationOtherAssembly()
        {
            MyLocalizedInOtherAssemblyEnumeration enumeration = MyLocalizedInOtherAssemblyEnumeration.Value1;

            string localized = LocalizedEnumConverter.ConvertValueToString(enumeration);

            Assert.AreEqual(Resources.MyFarResources.Value1, localized);
        }
Beispiel #4
0
        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);
        }