/// <summary> /// Helper to enqueue a new method dispatcher. /// </summary> /// <param name="method">The method reflection object.</param> private void EnqueueMethodDispatcher(MethodInfo method) { object o = ClassInstances.GetInstance(method.ReflectedType); if (o == null) { throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, "Object of type {0} could not be instantiated.", method.ReflectedType.ToString())); } // CustomTest was known in the first release as "SilverlightTest" // These are tests that are not compatible with the full framework // as the properties, methods and other features exposed are custom // to this harness. CustomFrameworkUnitTest customTest = o as CustomFrameworkUnitTest; if (customTest != null) { TestHarness.PrepareCustomTestInstance(customTest); } Enqueue(new UnitTestMethodContainer( TestHarness, o, method, null, TestGranularity.TestScenario)); }
/// <summary> /// Sets the unit test harness property for a test case that inherits /// from the abstract base type 'CustomTest'. /// </summary> /// <param name="customTest">A CustomText instance.</param> public void PrepareCustomTestInstance(CustomFrameworkUnitTest customTest) { customTest.UnitTestHarness = this; }