예제 #1
0
        private object RunTestMethod(TestExecutionContext context)
        {
            // [DuongNT]: Sleep 50 ms to reduce CPU consumption
            ++TSettings.CurTCIndex;
            if (TSettings.CurTCIndex % 10 == 0)
            {
                Thread.Sleep(2000);
            }
            else
            {
                Thread.Sleep(TSettings.GetInstance().GetDefaultTCDelay());
            }

            TUnit.TLogger.Write("##### Running Test Case [" + TSettings.CurTCIndex + "]: " + testMethod.Method.TypeInfo.FullName + "." +
                                testMethod.Method.Name);

#if NET_4_0 || NET_4_5 || PORTABLE
            if (AsyncInvocationRegion.IsAsyncOperation(testMethod.Method.MethodInfo))
            {
                return(RunAsyncTestMethod(context));
            }
            else
#endif
            return(RunNonAsyncTestMethod(context));
        }
예제 #2
0
 public static TSettings GetInstance()
 {
     lock (lockObject)
     {
         if (_instance == null)
         {
             _instance = new TSettings();
         }
     }
     return(_instance);
 }