Tmx.Core.TestResultsExporter.GetTestResultsXElement C# (CSharp) Method

GetTestResultsXElement() private method

private GetTestResultsXElement ( ITestResult testResult, IXMLElementsStruct xmlStruct ) : System.Xml.Linq.XElement
testResult ITestResult
xmlStruct IXMLElementsStruct
return System.Xml.Linq.XElement
        XElement GetTestResultsXElement(
                ITestResult testResult,
                IXMLElementsStruct xmlStruct)
        {
            var testResultsElement =
                new XElement(xmlStruct.TestResultNode,
                             new XAttribute("uniqueId", testResult.UniqueId),
                             new XAttribute("id", testResult.Id),
                             new XAttribute("name", testResult.Name),
                             new XAttribute("status", testResult.Status),
                             new XAttribute("origin", testResult.Origin),
                             CreateXattribute(xmlStruct.TimeSpentAttribute, Convert.ToInt32(testResult.TimeSpent)), // ??
                             CreateXelement(
                                 "source",
                                 CreateXattribute("scriptName", testResult.ScriptName),
                                 CreateXattribute("lineNumber", testResult.LineNumber),
                                 CreateXattribute("position", testResult.Position),
                                 CreateXattribute("code", testResult.Code)
                                ),
                             CreateXattribute(xmlStruct.TimeStampAttribute, testResult.Timestamp),
                             CreateXelement(
                                 "error",
                                 CreateXattribute("error", testResult.Error)
                                ),
                             CreateXattribute("screenshot", testResult.Screenshot),
                             CreateXattribute("description", testResult.Description),
                             CreateXattribute("platformId", testResult.PlatformId),
                             CreateXattribute("platformUniqueId", testResult.PlatformUniqueId),
                             CreateTestResultDetailsXElement(
                                 testResult,
                                 xmlStruct)
                            );

            return testResultsElement;
        }