Exemplo n.º 1
0
 /// <summary>
 /// Sort the test classes if the settings for alphabetical sorting are
 /// present.
 /// </summary>
 /// <param name="tests">List of test classes.</param>
 protected void SortTestClasses(IList <ITestClass> tests)
 {
     if (_settings != null)
     {
         TestAssemblyHelper.SortTestClasses(tests);
     }
 }
Exemplo n.º 2
0
        /// <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);
        }