Warning() 공개 메소드

Log a warning message.
public Warning ( string warningMessage ) : void
warningMessage string The warning message string.
리턴 void
 /// <summary>
 /// Look through the classes for the [Exclusive] attribute. If found, 
 /// remove any classes where the attribute is not present.
 /// </summary>
 /// <param name="classes">The input list of classes.</param>
 /// <param name="logWriter">The log writer object.</param>
 public static void FilterExclusiveClasses(IList<ITestClass> classes, LogMessageWriter logWriter)
 {
     if (!TestAssemblyHelper.HasExclusiveClasses(classes))
     {
         return;
     }
     if (logWriter != null && ! _hasWarned)
     {
         logWriter.Warning(Properties.UnitTestMessage.TestClassHelper_ExclusiveClassesInUse);
         _hasWarned = true;
     }
     List<ITestClass> filtered = new List<ITestClass>();
     foreach (ITestClass cl in classes)
     {
         if (ReflectionUtility.HasAttribute(cl.Type, typeof(ExclusiveAttribute)))
         {
             filtered.Add(cl);
         }
     }
     classes.Replace(filtered);
 }
 /// <summary>
 /// Look through the methods for the [Exclusive] attribute. If found, 
 /// remove any methods where the attribute is not present.
 /// </summary>
 /// <param name="methods">The methods to filter.</param>
 /// <param name="logWriter">The log writer object.</param>
 public static void FilterExclusiveMethods(IList<ITestMethod> methods, LogMessageWriter logWriter)
 {
     if (HasExclusiveMethods(methods) == false)
     {
         return;
     }
     if (logWriter != null && ! _hasWarned)
     {
         logWriter.Warning(Properties.UnitTestMessage.TestMethodHelper_ExclusiveMethodsInUse);
         _hasWarned = true;
     }
     List<ITestMethod> filtered = new List<ITestMethod>();
     foreach (var m in methods)
     {
         if (ReflectionUtility.HasAttribute(m, typeof(ExclusiveAttribute)))
         {
             filtered.Add(m);
         }
     }
     methods.Replace(filtered);
 }
예제 #3
0
        /// <summary>
        /// Look through the methods for the [Exclusive] attribute. If found,
        /// remove any methods where the attribute is not present.
        /// </summary>
        /// <param name="methods">The methods to filter.</param>
        /// <param name="logWriter">The log writer object.</param>
        public static void FilterExclusiveMethods(IList <ITestMethod> methods, LogMessageWriter logWriter)
        {
            if (HasExclusiveMethods(methods) == false)
            {
                return;
            }
            if (logWriter != null && !_hasWarned)
            {
                logWriter.Warning(Properties.UnitTestMessage.TestMethodHelper_ExclusiveMethodsInUse);
                _hasWarned = true;
            }
            List <ITestMethod> filtered = new List <ITestMethod>();

            foreach (var m in methods)
            {
                if (ReflectionUtility.HasAttribute(m, typeof(ExclusiveAttribute)))
                {
                    filtered.Add(m);
                }
            }
            methods.Replace(filtered);
        }
        /// <summary>
        /// Look through the classes for the [Exclusive] attribute. If found,
        /// remove any classes where the attribute is not present.
        /// </summary>
        /// <param name="classes">The input list of classes.</param>
        /// <param name="logWriter">The log writer object.</param>
        public static void FilterExclusiveClasses(IList <ITestClass> classes, LogMessageWriter logWriter)
        {
            if (!TestAssemblyHelper.HasExclusiveClasses(classes))
            {
                return;
            }
            if (logWriter != null && !_hasWarned)
            {
                logWriter.Warning(Properties.UnitTestMessage.TestClassHelper_ExclusiveClassesInUse);
                _hasWarned = true;
            }
            List <ITestClass> filtered = new List <ITestClass>();

            foreach (ITestClass cl in classes)
            {
                if (ReflectionUtility.HasAttribute(cl.Type, typeof(ExclusiveAttribute)))
                {
                    filtered.Add(cl);
                }
            }
            classes.Replace(filtered);
        }