Пример #1
0
 private static bool CoerceTypes(ref object left, ref object right)
 {
     if (NumberUtils.IsNumber(left) && NumberUtils.IsNumber(right))
     {
         NumberUtils.CoerceTypes(ref right, ref left);
         return(true);
     }
     return(false);
 }
Пример #2
0
 public void IsNumber()
 {
     Assert.IsTrue(NumberUtils.IsNumber(10));
     Assert.IsTrue(NumberUtils.IsNumber(10L));
     Assert.IsTrue(NumberUtils.IsNumber((short)10));
     Assert.IsFalse(NumberUtils.IsNumber('e'));
     Assert.IsFalse(NumberUtils.IsNumber(null));
     Assert.IsTrue(NumberUtils.IsNumber(9.5D));
     Assert.IsTrue(NumberUtils.IsNumber(9.5F));
     Assert.IsFalse(NumberUtils.IsNumber(this));
     Assert.IsFalse(NumberUtils.IsNumber(null));
     Assert.IsFalse(NumberUtils.IsNumber(string.Empty));
 }