示例#1
0
        /// <inheritdoc/>
        public virtual TestRunnerResult RunAssembly(IEnumerable <IResultXmlTransform> transforms)
        {
            XmlNode assemblyNode = null;

            logger.AssemblyStart(wrapper.AssemblyFilename, wrapper.ConfigFilename, wrapper.XunitVersion);

            TestRunnerResult result = CatchExceptions(() =>
            {
                assemblyNode = wrapper.RunAssembly(node => XmlLoggerAdapter.LogNode(node, logger));
                return(TestRunnerResult.NoTests);
            });

            if (result == TestRunnerResult.Failed)
            {
                return(TestRunnerResult.Failed);
            }
            if (assemblyNode == null)
            {
                return(TestRunnerResult.NoTests);
            }

            string assemblyXml = assemblyNode.OuterXml;

            foreach (IResultXmlTransform transform in transforms)
            {
                transform.Transform(assemblyXml);
            }

            return(ParseNodeForTestRunnerResult(assemblyNode));
        }