Example #1
0
        public void InvariantWorks()
        {
            var format = NumberFormatInfo.InvariantInfo;

            Assert.AreEqual("NaN", format.NaNSymbol);
            Assert.AreEqual("-", format.NegativeSign);
            Assert.AreEqual("+", format.PositiveSign);
            Assert.AreEqual("-Infinity", format.NegativeInfinitySymbol);
            Assert.AreEqual("Infinity", format.PositiveInfinitySymbol);

            Assert.AreEqual("%", format.PercentSymbol);
            Assert.AreEqual(new[] { 3 }, format.PercentGroupSizes);
            Assert.AreEqual(2, format.PercentDecimalDigits);
            Assert.AreEqual(".", format.PercentDecimalSeparator);
            Assert.AreEqual(",", format.PercentGroupSeparator);
            Assert.AreEqual(0, format.PercentPositivePattern);
            Assert.AreEqual(0, format.PercentNegativePattern);

            // "ยค"
            Assert.AreEqual(StringPrototype.FromCharCode(164), format.CurrencySymbol);
            Assert.AreEqual(new[] { 3 }, format.CurrencyGroupSizes);
            Assert.AreEqual(2, format.CurrencyDecimalDigits);
            Assert.AreEqual(".", format.CurrencyDecimalSeparator);
            Assert.AreEqual(",", format.CurrencyGroupSeparator);
            Assert.AreEqual(0, format.CurrencyNegativePattern);
            Assert.AreEqual(0, format.CurrencyPositivePattern);

            Assert.AreEqual(new[] { 3 }, format.NumberGroupSizes);
            Assert.AreEqual(2, format.NumberDecimalDigits);
            Assert.AreEqual(".", format.NumberDecimalSeparator);
            Assert.AreEqual(",", format.NumberGroupSeparator);
        }
Example #2
0
 public void FromCharCodeWorks()
 {
     Assert.AreEqual("", StringPrototype.FromCharCode());
     Assert.AreEqual("a", StringPrototype.FromCharCode('a'));
     Assert.AreEqual("ab", StringPrototype.FromCharCode('a', 'b'));
     Assert.AreEqual("abc", StringPrototype.FromCharCode('a', 'b', 'c'));
 }