Example #1
0
        public void ParseToStringRoundTrip(
            [CombinatorialValues(
                 "123456789012345678901234567.890123456",
                 "79228162514264337593543950335.000000001",
                 MaxText,
                 EpsilonText,
                 "5",
                 "50",
                 "50.01",
                 "0.1",
                 "0.123",
                 "0.00123"
                 )]
            string text, bool negate)
        {
            if (negate)
            {
                text = "-" + text;
            }
            BigQueryNumeric numeric = BigQueryNumeric.Parse(text);

            Assert.Equal(text, numeric.ToString());

            // Check that TryParse works too
            Assert.True(BigQueryNumeric.TryParse(text, out var numeric2));
            Assert.Equal(numeric, numeric2);
        }
Example #2
0
        public void ConversionFromDecimal(
            [CombinatorialValues(
                 "1",
                 "10",
                 "1.123456789",
                 "79228162514264337593543950335", // decimal.MaxValue
                 "1234567890123456789012345678"
                 )]
            string text, bool negate)
        {
            if (negate)
            {
                text = "-" + text;
            }
            decimal         parsed  = decimal.Parse(text, CultureInfo.InvariantCulture);
            BigQueryNumeric numeric = (BigQueryNumeric)parsed;

            Assert.Equal(text, numeric.ToString());
        }
Example #3
0
        public void ConversionFromUInt64(ulong input)
        {
            BigQueryNumeric value = input;

            Assert.Equal(input.ToString(CultureInfo.InvariantCulture), value.ToString());
        }
Example #4
0
 public string ToString_Integer() => IntegerSample.ToString();
Example #5
0
 public string ToString_Medium() => MediumSample.ToString();
Example #6
0
 public string ToString_Huge() => HugeSample.ToString();