Exemplo n.º 1
0
        public void InvariantFormat_Format_4()
        {
            Assert.AreEqual
            (
                "Length=1000, Height=2000, Width=3000",
                InvariantFormat.Format
                (
                    "Length={0}, Height={1}, Width={2}",
                    1000,
                    2000,
                    3000
                )
            );

            Assert.AreEqual
            (
                "Length=1000.5, Height=2000.5, Width=3000.5",
                InvariantFormat.Format
                (
                    "Length={0}, Height={1}, Width={2}",
                    1000.5,
                    2000.5,
                    3000.5
                )
            );
        }
Exemplo n.º 2
0
        public void InvariantFormat_Format_1()
        {
            Assert.AreEqual
            (
                "10000",
                InvariantFormat.Format(10000)
            );

            Assert.AreEqual
            (
                "10000.5",
                InvariantFormat.Format(10000.5)
            );

            Assert.AreEqual
            (
                "10000.5",
                InvariantFormat.Format(10000.5m)
            );
        }
Exemplo n.º 3
0
        public void InvariantFormat_Format_2()
        {
            Assert.AreEqual
            (
                "Length=1000",
                InvariantFormat.Format("Length={0}", 1000)
            );

            Assert.AreEqual
            (
                "Length=1000.5",
                InvariantFormat.Format("Length={0}", 1000.5)
            );

            Assert.AreEqual
            (
                "Length=1000.5",
                InvariantFormat.Format
                (
                    "Length={0}",
                    (object)1000.5
                )
            );
        }