Exemplo n.º 1
0
        public void CommaFormat()
        {
            string num1       = "1";
            string num1result = Formatting.CommaInteger(num1);

            Assert.AreEqual("1", num1result);

            string num2       = "12";
            string num2result = Formatting.CommaInteger(num2);

            Assert.AreEqual("12", num2result);

            string num3       = "123";
            string num3result = Formatting.CommaInteger(num3);

            Assert.AreEqual("123", num3result);

            string num4       = "1234";
            string num4result = Formatting.CommaInteger(num4);

            Assert.AreEqual("1,234", num4result);

            string num5       = "12345";
            string num5result = Formatting.CommaInteger(num5);

            Assert.AreEqual("12,345", num5result);

            string num6       = "123456";
            string num6result = Formatting.CommaInteger(num6);

            Assert.AreEqual("123,456", num6result);

            string num7       = "1234567";
            string num7result = Formatting.CommaInteger(num7);

            Assert.AreEqual("1,234,567", num7result);

            string num8       = "123456789123456";
            string num8result = Formatting.CommaInteger(num8);

            Assert.AreEqual("123,456,789,123,456", num8result);
        }