internal ManagedTestCase CreateManagedTestCase(TestCaseMetadata runningTestCase) { XElement xmanagedTestMethod = runningTestCase.TestCase.DataElement.Element(XTestCaseNames.ManagedTestMethod); if (xmanagedTestMethod == null) { throw new Exception("Test case xml missing element " + XTestCaseNames.ManagedTestMethod); } // Get the test assembly Assembly testAssembly = Assembly.LoadFrom((string)xmanagedTestMethod.Attribute("assemblyLocation")); // Determine the managed test method string testName = (string)xmanagedTestMethod.Attribute("fullClassName") + "." + (string)xmanagedTestMethod.Attribute("methodName"); int argCount = runningTestCase.TestArgs == null ? 0 : runningTestCase.TestArgs.Values.Length; MethodInfo testMethod = UnitTestsUtil.FindUnitTestMethodByName(testAssembly, testName, argCount); // And the args object[] args = argCount == 0 ? null : UnitTestsUtil.ParseCommandLineArguments(testMethod, runningTestCase.TestArgs.Values); ITestContext context = CreateTestContext(runningTestCase); return(new ManagedTestCase(testMethod, context, args)); }