Esempio n. 1
0
 static XElement CreateFailureElement(IFailureInformation failureInfo)
 => new XElement("failure",
                 new XAttribute("exception-type", failureInfo.ExceptionTypes[0]),
                 new XElement("message", new XCData(XmlEscape(ExceptionUtility.CombineMessages(failureInfo)))),
                 new XElement("stack-trace", new XCData(ExceptionUtility.CombineStackTraces(failureInfo) ?? string.Empty))
                 );
        /// <summary>
        /// Handles instances of <see cref="ITestFailed" />.
        /// </summary>
        protected virtual void HandleTestFailed(MessageHandlerArgs <ITestFailed> args)
        {
            var testFailed = args.Message;

            logger.LogImportantMessage($"##teamcity[testFailed name='{Escape(displayNameFormatter.DisplayName(testFailed.Test))}' details='{Escape(ExceptionUtility.CombineMessages(testFailed))}|r|n{Escape(ExceptionUtility.CombineStackTraces(testFailed))}' flowId='{ToFlowId(testFailed.TestCollection.DisplayName)}']");
            LogFinish(testFailed);
        }