public static XElement GetChessXActionMatchingStartOf(this TestRunEntity testRun, string actionText) { return(testRun.DataElement .Elements(XTestResultNames.TestResult) .Elements(XChessNames.ChessResults) .Elements(XChessNames.Action) // We want the actions just under the 'results' element, not from within any 'result' .Where(x => actionText.StartsWith((string)x.Attribute(XNames.AName))) .SingleOrDefault()); }
/// <summary> /// Gets the last chess schedule executed by the run. /// </summary> /// <param name="testRun"></param> /// <returns></returns> public static XElement GetLastXSchedule(this TestRunEntity testRun) { if (testRun == null || testRun.Result == null) { return(null); } return(testRun.Result.DataElement .Elements(XChessNames.ChessResults) .Elements(XChessNames.Schedule) .LastOrDefault()); }