Exemple #1
0
 /// <summary>
 /// Create a new assembly manager, takes in the harness, provider 
 /// reference and actual IAssembly object.
 /// </summary>
 /// <param name="runFilter">The test run filter object.</param>
 /// <param name="testHarness">Harness object.</param>
 /// <param name="provider">The unit test metadata provider.</param>
 /// <param name="testAssembly">The test assembly metadata object.</param>
 public AssemblyManager(TestRunFilter runFilter, UnitTestHarness testHarness, IUnitTestProvider provider, IAssembly testAssembly) : base(testHarness, provider)
 {
     _filter = runFilter;
     _assembly = testAssembly;
     _testClasses = new CompositeWorkItem();
     ClassInstances = new TestClassInstanceDictionary();
 }
Exemple #2
0
 /// <summary>
 /// A container type that handles an entire test class throughout the 
 /// test run.
 /// </summary>
 /// <param name="filter">Test run filter object.</param>
 /// <param name="testHarness">The unit test harness.</param>
 /// <param name="testClass">The test class metadata interface.</param>
 /// <param name="instance">The object instance.</param>
 /// <param name="provider">The unit test provider.</param>
 public TestClassManager(TestRunFilter filter, UnitTestHarness testHarness, ITestClass testClass, object instance, IUnitTestProvider provider) : base(testHarness, provider)
 {
     _filter = filter;
     _testClass = testClass;
     _testExecutionQueue = new CompositeWorkItem();
     _instance = instance;
 }
 /// <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>
 /// Enqueues a test assembly.
 /// </summary>
 /// <param name="testAssembly">The test assembly metadata.</param>
 /// <param name="runFilter">The run filter settings for the test assembly's run.</param>
 public void EnqueueTestAssembly(IAssembly testAssembly, TestRunFilter runFilter)
 {
     AssemblyManager assemblyManager = LogicFactory.CreateAssemblyManager(testAssembly.Provider, runFilter, testAssembly);
     _harnessTasks.Enqueue(assemblyManager);
     _knownTestMethods = CalculateTotalMethods(assemblyManager, testAssembly, runFilter);
     ++_validTestAssemblies;
 }
 /// <summary>
 /// Enqueue a test assembly from a simple Assembly reference.
 /// </summary>
 /// <param name="assembly">The test assembly.</param>
 /// <param name="runFilter">The run filter settings for the test assembly's run.</param>
 public void EnqueueTestAssembly(Assembly assembly, TestRunFilter runFilter)
 {
     IAssembly testAssembly = UnitTestProviders.GetAssemblyWrapper(this, assembly);
     if (testAssembly != null)
     {
         EnqueueTestAssembly(testAssembly, runFilter);
     }
 }
	public RuntimeVersionTestRunFilter(UnitTestSettings settings, UnitTestHarness harness, TestRunFilter subfilter) : base(settings, harness)
        {
		this.subfilter = subfilter;
		this.runtime_version = settings.RuntimeVersion;
        }
 /// <summary>
 /// Enqueues a message containing a test run filter.
 /// </summary>
 /// <param name="filter">The test run filter.</param>
 public void TestRunFilterSelected(TestRunFilter filter)
 {
     string message = filter.TestRunName;
     LogMessage m = Create(LogMessageType.TestInfrastructure, message);
     MarkUnitTestMessage(m);
     m[UnitTestLogDecorator.TestRunFilter] = filter;
     Enqueue(m);
 }