コード例 #1
0
        public void ToString_Format_Exception(string format, string provider)
        {
            if (provider != null)
            {
                formatProvider = new CultureInfo(provider);
            }

            CustomFormatProvider customFormatProvider = new CustomFormatProvider(formatProvider);

            Assert.That(() => customFormatProvider.Format(format, customer, formatProvider), Throws.TypeOf <FormatException>());
        }
コード例 #2
0
        public string ToString_Format_CustomerFormatProvider(string format, string provider)
        {
            if (provider != null)
            {
                formatProvider = new CultureInfo(provider);
            }

            CustomFormatProvider customFormatProvider = new CustomFormatProvider(formatProvider);

            return(customFormatProvider.Format(format, customer, formatProvider));
        }