private static bool?IsDirectPath(string propertyPath)
        {
            // ""
            if (string.IsNullOrWhiteSpace(propertyPath))
            {
                return(null);
            }

            var length = propertyPath.Length;

            //"."
            if (length == 1 && propertyPath == ".")
            {
                return(null);
            }

            var firstIdxOfPoint = propertyPath.IndexOf('.');

            // ".." => false
            if (firstIdxOfPoint == 0)
            {
                return(null);
            }

            // "A." => false ==> return !false -> true
            // "AA." => false ==> return !false -> true
            // "A.A" => true ==> return !true -> false
            return(!NumericJudge.IsBetween(firstIdxOfPoint, 1, length - 2));
        }
 public void NumericShouldBeUInt64Test()
 {
     NumericJudge.IsUInt64("64").ShouldBeTrue();
     NumericJudge.IsUInt64("64000000000000000000000000000000000000000000000000000000000000000000000000000000").ShouldBeFalse();
     NumericJudge.IsUInt64("-64").ShouldBeFalse();
     NumericJudge.IsUInt64("-64000000000000000000000000000000000000000000000000000000000000000000000000000000").ShouldBeFalse();
 }
 public void NumericShouldBeUInt32Test()
 {
     NumericJudge.IsUInt32("32").ShouldBeTrue();
     NumericJudge.IsUInt32("320000000000000").ShouldBeFalse();
     NumericJudge.IsUInt32("-32").ShouldBeFalse();
     NumericJudge.IsUInt32("-320000000000000").ShouldBeFalse();
 }
 public void NumericShouldBeUInt16Test()
 {
     NumericJudge.IsUInt16("16").ShouldBeTrue();
     NumericJudge.IsUInt16("1600000").ShouldBeFalse();
     NumericJudge.IsUInt16("-16").ShouldBeFalse();
     NumericJudge.IsUInt16("-1600000").ShouldBeFalse();
 }
        public void NaNTest()
        {
            var number1 = double.NaN;
            var number2 = float.NaN;

            NumericJudge.IsNaN(number1).ShouldBeTrue();
            NumericJudge.IsNaN(number2).ShouldBeTrue();
            NumericJudge.IsNaN(123).ShouldBeFalse();
        }
        public void NumericBetweenTest()
        {
            short   a = 1;
            int     b = 1;
            long    c = 1;
            float   d = 1;
            double  e = 1;
            decimal f = 1;

            NumericJudge.IsBetween(a, (short)0, (short)2).ShouldBeTrue();
            NumericJudge.IsBetween(b, 0, 2).ShouldBeTrue();
            NumericJudge.IsBetween(c, 0, 2).ShouldBeTrue();
            NumericJudge.IsBetween(d, 0, 2).ShouldBeTrue();
            NumericJudge.IsBetween(e, 0, 2).ShouldBeTrue();
            NumericJudge.IsBetween(f, 0, 2).ShouldBeTrue();
        }