/// <summary> /// Logs the class node by calling <see cref="IRunnerLogger.ClassFailed"/> (if the class failed). /// The exception type was added in xUnit.net 1.1, so when the test assembly is linked against /// xUnit.net versions prior to 1.1, the exception type will be null. /// </summary> /// <param name="classNode">The class node.</param> /// <param name="logger">The logger.</param> /// <returns>Returns true if the user wishes to continue running tests; returns false otherwise.</returns> public static bool LogClassNode(XmlNode classNode, IRunnerLogger logger) { if (classNode.SelectSingleNode("failure") != null) { string exceptionType = null; XmlNode failureNode = classNode.SelectSingleNode("failure"); // Exception type node was added in 1.1, so it might not be present if (failureNode.Attributes["exception-type"] != null) exceptionType = failureNode.Attributes["exception-type"].Value; return logger.ClassFailed(classNode.Attributes["name"].Value, exceptionType, failureNode.SelectSingleNode("message").InnerText, failureNode.SelectSingleNode("stack-trace").InnerText); } return true; }
/// <summary> /// Logs the class node by calling <see cref="IRunnerLogger.ClassFailed"/> (if the class failed). /// The exception type was added in xUnit.net 1.1, so when the test assembly is linked against /// xUnit.net versions prior to 1.1, the exception type will be null. /// </summary> /// <param name="classNode">The class node.</param> /// <param name="logger">The logger.</param> /// <returns>Returns true if the user wishes to continue running tests; returns false otherwise.</returns> public static bool LogClassNode(XmlNode classNode, IRunnerLogger logger) { if (classNode.SelectSingleNode("failure") != null) { string exceptionType = null; XmlNode failureNode = classNode.SelectSingleNode("failure"); // Exception type node was added in 1.1, so it might not be present if (failureNode.Attributes["exception-type"] != null) { exceptionType = failureNode.Attributes["exception-type"].Value; } return(logger.ClassFailed(classNode.Attributes["name"].Value, exceptionType, failureNode.SelectSingleNode("message").InnerText, failureNode.SelectSingleNode("stack-trace").InnerText)); } return(true); }