/// <summary> /// Collect all test cases thatare asociated with one user story. /// </summary> /// <param name="testReports">Colelction of test reports <see cref="TestReports"/></param> /// <param name="userStory">Nameof the user story</param> /// <returns>List of test cases</returns> private static UserStoryData GetTestCasesForUserStory(TestReports testReports, string userStory) { UserStoryData testCases = new UserStoryData(); foreach (KeyValuePair <string, ReportData> keyValuePair in testReports.Reports) { IList <UserStory> userStories = UserStoryDataMiner.GetUserStoryDetails(keyValuePair.Value); foreach (UserStory story in userStories) { if (story.UserStoryName == userStory) { foreach (ReportCase reportCase in story.TestCases) { testCases.AddReportCase(reportCase); } } } } return(testCases); }
/// <summary> /// Parsesall available reports. /// </summary> /// <param name="testReports">Colelction of test reports <see cref="TestReports"/></param> private void ParseAllReports(TestReports testReports) { DirectoryInfo directoryInfo = new DirectoryInfo(FolderWithReportFiles); FileInfo[] reportFiles = directoryInfo.GetFiles("*.xml"); foreach (FileInfo fileInfo in reportFiles) { ReportData reportData; using (ReportDataParser parser = new ReportDataParser(fileInfo.FullName)) { reportData = parser.Parse(); } testReports.Reports.Add(fileInfo.Name, reportData); IList <UserStory> userStories = UserStoryDataMiner.GetUserStoryDetails(reportData); foreach (UserStory userStory in userStories) { testReports.AddUserStoryName(userStory.UserStoryName); } } }