[Multimedia] Add Validation util and rename filename (#2974)
authorhsgwon <haesu.gwon@samsung.com>
Thu, 6 May 2021 02:15:12 +0000 (11:15 +0900)
committerGitHub <noreply@github.com>
Thu, 6 May 2021 02:15:12 +0000 (11:15 +0900)
src/Tizen.Multimedia/Common.Internal/ValidationUtil.cs [moved from src/Tizen.Multimedia/Common.Internal/ValdiationUtil.cs with 70% similarity]

@@ -15,7 +15,9 @@
  */
 
 using System;
+using System.Collections.Generic;
 using System.Globalization;
+using System.Linq;
 
 namespace Tizen.Multimedia
 {
@@ -44,5 +46,26 @@ namespace Tizen.Multimedia
                 throw new NotSupportedException($"The feature({featureKey}) is not supported.");
             }
         }
+
+        internal static void ValidateIsNullOrEmpty(string value, string paramName)
+        {
+            if (value == null)
+            {
+                throw new ArgumentNullException(paramName);
+            }
+
+            if (string.IsNullOrWhiteSpace(value))
+            {
+                throw new ArgumentException(paramName + " is a zero-length string.", paramName);
+            }
+        }
+
+        internal static void ValidateIsAny<T>(this IEnumerable<T> enumerable)
+        {
+            if (enumerable == null || !enumerable.Any<T>())
+            {
+                throw new ArgumentNullException(nameof(enumerable));
+            }
+        }
     }
 }