Beispiel #1
0
        /// <summary>
        /// Loads a type as a test using either the test suite
        /// mechansm or the fixture mechanism.
        /// </summary>
        /// <param name="type">The type to be loaded</param>
        /// <returns>A test constructed on that type</returns>
        public static ITest Load(Type type)
        {
            ITest test = TestLoader.LoadAsSuite(type);

            if (test == null)
            {
                test = new TestSuite(type);
            }

            return(test);
        }
Beispiel #2
0
        /// <summary>
        /// Loads a test suite containing multiple tests from an assembly
        /// </summary>
        /// <param name="tests">String array containing the names of the test classes to load</param>
        /// <returns>A suite containing all the tests</returns>
        public static ITest Load(Assembly assembly, string[] tests)
        {
            TestSuite suite = new TestSuite("Test Fixtures");

            foreach (string name in tests)
            {
                suite.AddTest(TestLoader.Load(assembly, name));
            }

            return(suite);
        }
Beispiel #3
0
 /// <summary>
 /// Runs a set of tests specified by name
 /// </summary>
 /// <param name="tests">Array of test names to be run</param>
 /// <returns>TestResult representing the result of the run</returns>
 public virtual TestResult Run(Assembly assembly, string[] tests)
 {
     return(Run(TestLoader.Load(assembly, tests)));
 }
Beispiel #4
0
 /// <summary>
 /// Runs all tests in the specified assembly.
 /// </summary>
 /// <param name="assembly">The assembly for which tests are to be run.</param>
 /// <returns>TestResult representing the result of the run</returns>
 public virtual TestResult Run(Assembly assembly)
 {
     return(Run(TestLoader.Load(assembly)));
 }