Beispiel #1
0
        public static IEnumerable <object[]> Parse_Invalid_TestData()
        {
            // Include the test data for wider primitives.
            foreach (object[] widerTests in UInt32Tests.Parse_Invalid_TestData())
            {
                yield return(widerTests);
            }

            // > max value
            yield return(new object[] { "65536", NumberStyles.Integer, null, typeof(OverflowException) });

            yield return(new object[] { "10000", NumberStyles.HexNumber, null, typeof(OverflowException) });
        }
Beispiel #2
0
 public static IEnumerable <object[]> Parse_Invalid_TestData()
 {
     // Reuse all uint test data, except for those that wouldn't overflow ulong.
     foreach (object[] objs in UInt32Tests.Parse_Invalid_TestData())
     {
         if ((Type)objs[3] == typeof(OverflowException) &&
             (!BigInteger.TryParse((string)objs[0], out BigInteger bi) || bi <= ulong.MaxValue))
         {
             continue;
         }
         yield return(objs);
     }
 }