Exemple #1
0
 public static bool IsEmpty(object obj)
 {
     if (obj == null)
     {
         return(true);
     }
     if (obj is string)
     {
         return(string.IsNullOrEmpty((string)obj));
     }
     if (obj is IEnumerable)
     {
         return(CommonMacros.ArrayEmpty(obj));
     }
     return(false);
 }
Exemple #2
0
        public void CanDetectNotEmptyArray()
        {
            var arr = Enumerable.Range(1, 10);

            Assert.False(CommonMacros.ArrayEmpty(arr));
        }