Пример #1
0
        /// <summary>
        /// Runs the specified tests in the given type, calling the callback as appropriate.
        /// This override point exists primarily for unit testing purposes.
        /// </summary>
        /// <param name="methods">The test methods to run</param>
        /// <param name="callback">The run status information callback.</param>
        protected virtual string RunTests(List <string> methods, ITestMethodRunnerCallback callback)
        {
            IRunnerLogger    logger  = new TestClassCallbackDispatcher(this, callback);
            IExecutorWrapper wrapper = TestAssembly.ExecutorWrapper;

            try
            {
                XmlNode classNode = wrapper.RunTests(TypeName, methods, node => XmlLoggerAdapter.LogNode(node, logger));
                return(classNode.OuterXml);
            }
            catch (Exception ex)
            {
                logger.ExceptionThrown(wrapper.AssemblyFilename, ex);
                return(String.Empty);
            }
        }
Пример #2
0
        /// <summary>
        /// Runs the specified tests in the given type, calling the callback as appropriate.
        /// This override point exists primarily for unit testing purposes.
        /// </summary>
        /// <param name="methods">The test methods to run</param>
        /// <param name="callback">The run status information callback.</param>
        protected virtual string RunTests(List<string> methods, ITestMethodRunnerCallback callback)
        {
            IRunnerLogger logger = new TestClassCallbackDispatcher(this, callback);
            IExecutorWrapper wrapper = TestAssembly.ExecutorWrapper;

            try
            {
                XmlNode classNode = wrapper.RunTests(TypeName, methods, node => XmlLoggerAdapter.LogNode(node, logger));
                return classNode.OuterXml;
            }
            catch (Exception ex)
            {
                logger.ExceptionThrown(wrapper.AssemblyFilename, ex);
                return String.Empty;
            }
        }