public void TestNumberGroupSizesLocale(string locale)
        {
            CultureInfo      myTestCulture = new CultureInfo(locale);
            NumberFormatInfo nfi           = myTestCulture.NumberFormat;

            int[] expected = NumberFormatInfoData.GetNumberGroupSizes(myTestCulture);
            Assert.Equal(expected, nfi.NumberGroupSizes);
        }
Example #2
0
        public static IEnumerable <object[]> NumberGroupSizes_TestData()
        {
            yield return(new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } });

            yield return(new object[] { new CultureInfo("en-US").NumberFormat, new int[] { 3 } });

            yield return(new object[] { new CultureInfo("ur-IN").NumberFormat, NumberFormatInfoData.UrINNumberGroupSizes() });
        }
Example #3
0
        public static IEnumerable <object[]> NegativeInfinitySymbol_TestData()
        {
            yield return(new object[] { NumberFormatInfo.InvariantInfo, "-Infinity" });

            yield return(new object[] { new CultureInfo("en-US").NumberFormat, NumberFormatInfoData.GetNegativeInfinitySymbol("en-US") });

            yield return(new object[] { new CultureInfo("fr-FR").NumberFormat, NumberFormatInfoData.GetNegativeInfinitySymbol("fr-FR") });
        }
Example #4
0
        public void PosTest1(string locale)
        {
            CultureInfo      myTestCulture = new CultureInfo(locale);
            NumberFormatInfo nfi           = myTestCulture.NumberFormat;
            string           actual        = nfi.NegativeInfinitySymbol;
            string           expected      = NumberFormatInfoData.GetNegativeInfinitySymbol(myTestCulture);

            Assert.Equal(expected, actual);
        }
Example #5
0
        public void TestCurrencyNegativePatternLocale(string locale)
        {
            CultureInfo      myTestCulture = new CultureInfo(locale);
            NumberFormatInfo nfi           = myTestCulture.NumberFormat;
            int actual = nfi.CurrencyNegativePattern;

            int[] acceptablePatterns = NumberFormatInfoData.GetCurrencyNegativePatterns(myTestCulture);
            Assert.True(acceptablePatterns.Contains(actual),
                        string.Format("'{0}' was not found in '[{1}]'", actual, string.Join(",", acceptablePatterns)));
        }
Example #6
0
        public static IEnumerable <object[]> NumberGroupSizes_TestData()
        {
            yield return(new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } });

            yield return(new object[] { new CultureInfo("en-US").NumberFormat, new int[] { 3 } });

            // TODO: when dotnet/corefx#2103 is addressed, we should also check fr-FR
            if (!PlatformDetection.IsUbuntu1510 && !PlatformDetection.IsWindows7)
            {
                yield return(new object[] { new CultureInfo("ur-IN").NumberFormat, NumberFormatInfoData.UrINNumberGroupSizes() });
            }
        }
        public static IEnumerable <object[]> NumberGroupSizes_TestData()
        {
            yield return(new object[] { NumberFormatInfo.InvariantInfo, new int[] { 3 } });

            yield return(new object[] { new CultureInfo("en-US").NumberFormat, new int[] { 3 } });

            // Culture does not exist on Windows 7
            if (!PlatformDetection.IsWindows7)
            {
                yield return(new object[] { new CultureInfo("ur-IN").NumberFormat, NumberFormatInfoData.UrINNumberGroupSizes() });
            }
        }
Example #8
0
        public void CurrencyNegativePattern_Get(string locale)
        {
            CultureInfo culture;

            try
            {
                culture = new CultureInfo(locale);
            }
            catch (CultureNotFoundException)
            {
                return; // ignore unsupported culture
            }

            NumberFormatInfo format = culture.NumberFormat;

            Assert.Contains(format.CurrencyNegativePattern, NumberFormatInfoData.GetCurrencyNegativePatterns(locale));
        }
Example #9
0
        public void CurrencyNegativePattern_Get(string locale)
        {
            NumberFormatInfo format = new CultureInfo(locale).NumberFormat;

            Assert.Contains(format.CurrencyNegativePattern, NumberFormatInfoData.GetCurrencyNegativePatterns(locale));
        }