GetTestClasses() private method

private GetTestClasses ( IAssembly assembly, TestClassInstanceDictionary instances ) : List
assembly IAssembly
instances TestClassInstanceDictionary
return List
Exemplo n.º 1
0
        /// <summary>
        /// Reflect over all test classes in the assembly and add any which are not
        /// filtered out into the test work item queue.
        /// </summary>
        private void EnqueueTestClasses()
        {
            IList <ITestClass> classes = _filter.GetTestClasses(_assembly, ClassInstances);

            foreach (ITestClass testClass in classes)
            {
                _testClasses.Enqueue(TestHarness.LogicFactory.CreateTestClassManager(Provider, _filter, testClass, ClassInstances.GetInstance(testClass.Type)));
            }
            Enqueue(_testClasses);
        }
        /// <summary>
        /// Calculates the number of methods for a run.
        /// </summary>
        /// <param name="assemblyManager">The assembly manager.</param>
        /// <param name="assembly">The test assembly.</param>
        /// <param name="filter">The test run filter.</param>
        /// <returns>Returns the number of known methods returned.</returns>
        private static int CalculateTotalMethods(AssemblyManager assemblyManager, IAssembly assembly, TestRunFilter filter)
        {
            int total             = 0;
            List <ITestClass> cls = filter.GetTestClasses(assembly, assemblyManager.ClassInstances);

            foreach (ITestClass test in cls)
            {
                object instance = assemblyManager.ClassInstances.GetInstance(test.Type);
                total += filter.GetTestMethods(test, instance).Count;
            }
            return(total);
        }
 /// <summary>
 /// Calculates the number of methods for a run.
 /// </summary>
 /// <param name="assemblyManager">The assembly manager.</param>
 /// <param name="assembly">The test assembly.</param>
 /// <param name="filter">The test run filter.</param>
 /// <returns>Returns the number of known methods returned.</returns>
 private static int CalculateTotalMethods(AssemblyManager assemblyManager, IAssembly assembly, TestRunFilter filter)
 {
     int total = 0;
     List<ITestClass> cls = filter.GetTestClasses(assembly, assemblyManager.ClassInstances);
     foreach (ITestClass test in cls)
     {
         object instance = assemblyManager.ClassInstances.GetInstance(test.Type);
         total += filter.GetTestMethods(test, instance).Count;
     }
     return total;
 }