diff Implab/Safe.cs @ 121:62d2f1e98c4e v2

working version of AsyncQueue and batch operations tests
author cin
date Mon, 12 Jan 2015 18:19:41 +0300
parents 2573b562e328
children f7b2b8bfbb8c
line wrap: on
line diff
--- a/Implab/Safe.cs	Mon Jan 12 05:19:52 2015 +0300
+++ b/Implab/Safe.cs	Mon Jan 12 18:19:41 2015 +0300
@@ -9,31 +9,31 @@
 {
     public static class Safe
     {
-        public static void ArgumentMatch(string param, string name, Regex rx) {
+        public static void ArgumentMatch(string value, string paramName, Regex rx) {
             if (rx == null)
                 throw new ArgumentNullException("rx");
-            if (!rx.IsMatch(param))
-                throw new ArgumentException(String.Format("The prameter value must match {0}", rx), name);
+            if (!rx.IsMatch(value))
+                throw new ArgumentException(String.Format("The prameter value must match {0}", rx), paramName);
         }
 
-        public static void ArgumentNotEmpty(string param, string name) {
-            if (String.IsNullOrEmpty(param))
-                throw new ArgumentException("The parameter can't be empty", name);
+        public static void ArgumentNotEmpty(string value, string paramName) {
+            if (String.IsNullOrEmpty(value))
+                throw new ArgumentException("The parameter can't be empty", paramName);
         }
 
-        public static void ArgumentNotEmpty<T>(T[] param, string name) {
-            if (param == null || param.Length == 0)
-                throw new ArgumentException("The array must be not emty", name);
+        public static void ArgumentNotEmpty<T>(T[] value, string paramName) {
+            if (value == null || value.Length == 0)
+                throw new ArgumentException("The array must be not emty", paramName);
         }
 
-        public static void ArgumentNotNull(object param, string name) {
-            if (param == null)
-                throw new ArgumentNullException(name);
+        public static void ArgumentNotNull(object value, string paramName) {
+            if (value == null)
+                throw new ArgumentNullException(paramName);
         }
 
-        public static void ArgumentInRange(int arg, int min, int max, string name) {
-            if (arg < min || arg > max)
-                throw new ArgumentOutOfRangeException(name);
+        public static void ArgumentInRange(int value, int min, int max, string paramName) {
+            if (value < min || value > max)
+                throw new ArgumentOutOfRangeException(paramName);
         }
 
         public static void Dispose<T>(T obj) where T : class