/// <summary> /// Gets a collection of test method wrapper instances. /// </summary> /// <returns>A collection of test method interface objects.</returns> public ICollection <ITestMethod> GetTestMethods() { if (!_testsLoaded) { ICollection <MethodInfo> methods = GetTestMethods(_type); _tests = new List <ITestMethod>(methods.Count); foreach (MethodInfo method in methods) { if (ClientTestRunConfiguration.ContainsMethod(method)) { if (method.HasAttribute(NUnitAttributes.TestCase)) { var dynamicMethods = GetDynamicTestMethodsForTestCases(method); foreach (var dynamicMethod in dynamicMethods) { _tests.Add(dynamicMethod); } } else { _tests.Add(new TestMethod(method)); } } } _testsLoaded = true; } return(_tests); }
private static IEnumerable <MethodTester> GetMethodTestersToRun(TestContext testContext) { return(testContext .Items .OfType <TestGroup>() .SelectMany(GetMethodTesters) .Where(w => ClientTestRunConfiguration.ContainsMethod(w.Method))); }
/// <summary> /// Gets a collection of test method wrapper instances. /// </summary> /// <returns>A collection of test method interface objects.</returns> public ICollection <ITestMethod> GetTestMethods() { if (!_testsLoaded) { var methods = GetTestMethods(_type); _tests = new List <ITestMethod>(methods.Count); foreach (MethodInfo method in methods) { if (ClientTestRunConfiguration.ContainsMethod(method)) { _tests.Add(new TestMethod(method)); } } _testsLoaded = true; } return(_tests); }
/// <summary> /// Gets a collection of test method wrapper instances. /// </summary> /// <returns>A collection of test method interface objects.</returns> public ICollection <ITestMethod> GetTestMethods() { if (!_testsLoaded) { ICollection <MethodInfo> methods = GetTestMethods(_type); _tests = new List <ITestMethod>(methods.Count); foreach (MethodInfo method in methods) { if (ClientTestRunConfiguration.ContainsMethod(method)) { // Using the MSTest frameworks's TestMethod here because // 1. There is no specific StatLight logic in the original ITestMethod implemenation done by StatLight // 2. The UnitTestContext class in the SL Testing Framework is protected and therefore I can't create that instance _tests.Add(new Microsoft.Silverlight.Testing.UnitTesting.Metadata.VisualStudio.TestMethod(method)); } } _testsLoaded = true; } return(_tests); }
private static IEnumerable <MethodTester> GetMethodTestersToRun(TestContext testContext) { return(GetMethodTesters(testContext).Where(w => ClientTestRunConfiguration.ContainsMethod(w.Method.MethodInfo))); }