Esempio n. 1
0
 private static void CheckByStrategies(object obj, string objName, ICheckStrategy[] strategies, ref bool assertion, ref string message)
 {
     if (strategies == null || strategies.Length == 0)
     {
         if (!NotNull.Pass(obj))
         {
             assertion = false;
             message   = NotNull.GetFailingMessage(objName);
         }
     }
     else
     {
         for (int i = 0; i < strategies.Length; ++i)
         {
             if (!strategies[i].Pass(obj))
             {
                 assertion = false;
                 message   = strategies[i].GetFailingMessage(objName);
                 break;
             }
         }
     }
 }
Esempio n. 2
0
 private static void CheckByStrategies(object obj, string objName, ICheckStrategy[] strategies,
     ref bool assertion, ref string message)
 {
     if (strategies == null || strategies.Length == 0)
     {
         if (!NotNull.Pass(obj))
         {
             assertion = false;
             message = NotNull.GetFailingMessage(objName);
         }
     }
     else
     {
         foreach (var t in strategies)
         {
             if (!t.Pass(obj))
             {
                 assertion = false;
                 message = t.GetFailingMessage(objName);
                 break;
             }
         }
     }
 }