public XElement CreateSuitesXElementWithParameters(
IOrderedEnumerable<ITestSuite> suites,
IOrderedEnumerable<ITestScenario> scenarios,
IOrderedEnumerable<ITestResult> testResults,
IXMLElementsStruct xmlStruct)
{
var suitesElement =
new XElement(xmlStruct.SuitesNode,
from suite in suites
select new XElement(xmlStruct.SuiteNode,
new XAttribute("uniqueId", suite.UniqueId),
new XAttribute("id", suite.Id),
new XAttribute("name", suite.Name),
new XAttribute("status", suite.Status),
CreateXattribute(xmlStruct.TimeSpentAttribute, Convert.ToInt32(suite.Statistics.TimeSpent)),
new XAttribute("all", suite.Statistics.All.ToString()),
new XAttribute("passed", suite.Statistics.Passed.ToString()),
CreateXattribute(xmlStruct.FailedAttribute, suite.Statistics.Failed.ToString()),
new XAttribute("notTested", suite.Statistics.NotTested.ToString()),
new XAttribute("knownIssue", suite.Statistics.PassedButWithBadSmell.ToString()),
CreateXattribute("description", suite.Description),
CreateXattribute("platformId", suite.PlatformId),
CreateXattribute("platformUniqueId", suite.PlatformUniqueId),
CreateScenariosXElementCommon(
suite,
// 20141122
// scenarios.Where(scenario => scenario.SuiteId == suite.Id).OrderBy(scenario => scenario.Id),
// testResults.Where(testResult => testResult.SuiteId == suite.Id).OrderBy(testResult => testResult.Id),
scenarios.Where(scenario => scenario.SuiteId == suite.Id && scenario.SuiteUniqueId == suite.UniqueId).OrderBy(scenario => scenario.Id),
testResults.Where(testResult => testResult.SuiteId == suite.Id && testResult.SuiteUniqueId == suite.UniqueId).OrderBy(testResult => testResult.Id),
xmlStruct)
)
);
return suitesElement;
}