Esempio n. 1
0
        public void ToString_ThrowsFormatException()
        {
            CustomerFormatProvider c = new CustomerFormatProvider();
            Customer customer        = new Customer("Jeffrey Richter", "+1 (425) 555-0100", 1000000);

            Assert.Throws <FormatException>(() => c.Format("a2", customer, null));
        }
Esempio n. 2
0
        public string ToString_PositiveTests(string format, IFormatProvider formatProvider)
        {
            CustomerFormatProvider c = new CustomerFormatProvider();
            Customer customer        = new Customer("Jeffrey Richter", "+1 (425) 555-0100", 1000000);

            return(c.Format(format, customer, formatProvider));
        }
Esempio n. 3
0
        public string ToString_Formatted_CustomerFormatProvider(string format, string provider)
        {
            CultureInfo            ci             = new CultureInfo(provider);
            CustomerFormatProvider formatprovider = new CustomerFormatProvider();
            Customer c1 = new Customer("Ksenia FalkoVich", "+375 (29) 777-7777", 11234.0089M);

            return(formatprovider.Format(format, c1, ci));
        }
Esempio n. 4
0
        public void Customer_Format_ThrowFormatException(object arg)
        {
            CustomerFormatProvider fp = new CustomerFormatProvider();

            Assert.Throws <FormatException>(() => fp.Format("LRP", arg, CultureInfo.InvariantCulture));
        }
Esempio n. 5
0
        public string Customer_Format_Test(string format)
        {
            CustomerFormatProvider fp = new CustomerFormatProvider();

            return(fp.Format(format, customer, CultureInfo.InvariantCulture));
        }
Esempio n. 6
0
        public string Format_Standalone_IsCorrect_WithCulture(string format, string culture)
        {
            CustomerFormatProvider provider = new CustomerFormatProvider();

            return(provider.Format(format, new CustomerLib.Customer("Jeffrey Richter", 1234567, "+1 (425) 555-0100"), new CultureInfo(culture)));
        }
Esempio n. 7
0
        public string Format_Standalone_IsCorrect(string format)
        {
            CustomerFormatProvider provider = new CustomerFormatProvider();

            return(provider.Format(format, new CustomerLib.Customer("Jeffrey Richter", 1234567, "+1 (425) 555-0100"), CultureInfo.InvariantCulture));
        }