示例#1
0
 /// <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)));
 }
示例#3
0
 /// <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);
 }
示例#4
0
 /// <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);
 }
示例#5
0
 private static IEnumerable <MethodTester> GetMethodTestersToRun(TestContext testContext)
 {
     return(GetMethodTesters(testContext).Where(w => ClientTestRunConfiguration.ContainsMethod(w.Method.MethodInfo)));
 }