/// <summary> /// Initializes a new instance of the <see cref="TfsTestSuite"/> class. /// </summary> /// <param name="testSuite">The test suite.</param> /// <param name="associatedTestPlan">The associated test plan.</param> public TfsTestSuite(IRequirementTestSuite testSuite, ITfsTestPlan associatedTestPlan) { AssociatedTestPlan = associatedTestPlan; OriginalRequirementTestSuite = testSuite; Id = OriginalRequirementTestSuite.Id; Title = OriginalRequirementTestSuite.Title; InitializeChildSuites(); }
/// <summary> /// Initializes a new instance of the <see cref="TestSpecificationReportModel"/> class for the console extension /// </summary> /// <param name="syncServiceDocumentModel">The <see cref="ISyncServiceModel"/> to obtain document settings.</param> /// <param name="testAdapter"><see cref="ITfsTestAdapter"/> to examine test information.</param> /// <param name="sort"></param> /// <param name="testReportingProgressCancellationService">The progess cancellation service used to check at certain points if a cancellation has been triggered and further steps should be skipped.</param> /// <param name="plan">The selected <see cref="ITfsTestPlan"/> used for the report generation.</param> /// <param name="suite">The selected <see cref="ITfsTestSuite"/> used for the report generation.</param> /// <param name="documentStructure">The information if a document structure should be created.</param> /// <param name="skipLevels">The level count to ignore generation.</param> /// <param name="structureType"></param> public TestSpecificationReportModel(ISyncServiceDocumentModel syncServiceDocumentModel, ITfsTestAdapter testAdapter, ITfsTestPlan plan, ITfsTestSuite suite, bool documentStructure, int skipLevels, DocumentStructureType structureType, TestCaseSortType sort, ITestReportingProgressCancellationService testReportingProgressCancellationService) : base(syncServiceDocumentModel, testAdapter, testReportingProgressCancellationService) { SelectedTestPlan = plan; SelectedTestSuite = suite; CreateDocumentStructure = documentStructure; SkipLevels = skipLevels; SelectedDocumentStructureType = structureType; SelectedTestCaseSortType = sort; CreateReportCommand = new ViewCommand(ExecuteCreateReportCommand, CanExecuteCreateReportCommand); WordDocument = syncServiceDocumentModel.WordDocument as Document; }
/// <summary> /// This method creates a word document with the TestSpecificationReport-Command /// </summary> public void CreateTestSpecDocument(DocumentConfiguration documentConfiguration) { try { SyncServiceTrace.D(Resources.CreateTestSpecificationDoc); _documentConfiguration = documentConfiguration; Initialize(); var testSpecSettings = _documentConfiguration.TestSpecSettings; var testAdapter = SyncServiceFactory.CreateTfsTestAdapter(_documentModel.TfsServer, _documentModel.TfsProject, _documentModel.Configuration); TestCaseSortType testCaseSortType; Enum.TryParse(testSpecSettings.SortTestCasesBy, out testCaseSortType); DocumentStructureType documentStructure; Enum.TryParse(testSpecSettings.DocumentStructure, out documentStructure); ITfsTestPlan testPlan = testAdapter.GetTestPlans(null).Where(plan => plan.Name == testSpecSettings.TestPlan).FirstOrDefault(); if (testPlan == null) { SyncServiceTrace.D(Resources.TestSettingsInvalidTestPlan); throw new ArgumentException(Resources.TestSettingsInvalidTestPlan); } var testSuiteSearcher = new TestSuiteSearcher(testPlan); var testSuite = testSuiteSearcher.SearchTestSuiteWithinTestPlan(testSpecSettings.TestSuite); var reportModel = new TestSpecificationReportModel(_documentModel, testAdapter, testPlan, testSuite, testSpecSettings.CreateDocumentStructure, testSpecSettings.SkipLevels, documentStructure, testCaseSortType, new TestReportingProgressCancellationService(false)); reportModel.CreateReport(); FinalizeDocument(); } catch (Exception e) { if (_wordApplication != null) { _wordApplication.Quit(); } // ReSharper disable once PossibleIntendedRethrow throw e; } }
/// <summary> /// Initializes a new instance of the <see cref="TestCaseHelper"/> class. /// </summary> /// <param name="testAdapter">Adapter to obtain information.</param> /// <param name="testPlan"><see cref="ITfsTestPlan"/> is the source of test cases to write out.</param> /// <param name="testConfiguration">Configuration filter used to determine test results for test case. <c>null</c> - all configurations.</param> /// <param name="serverBuild">Build filter used to determine test result for test case.</param> /// <param name="testCases">Collection of test cases - data source.</param> /// <param name="pathType">Path of test cases to use by all operations in this class. /// (Supported is <see cref="DocumentStructureType.IterationPath"/> and <see cref="DocumentStructureType.AreaPath"/>.)</param> public TestCaseHelper(ITfsTestAdapter testAdapter, ITfsTestPlan testPlan, ITfsTestConfiguration testConfiguration, ITfsServerBuild serverBuild, IEnumerable <ITfsTestCaseDetail> testCases, DocumentStructureType pathType) { if (testAdapter == null) { throw new ArgumentNullException("testAdapter"); } if (testCases == null) { throw new ArgumentNullException("testCases"); } CheckTestResults = true; TestAdapter = testAdapter; TestPlan = testPlan; TestConfiguration = testConfiguration; ServerBuild = serverBuild; TestCases = testCases; PathType = pathType; }
public TestSuiteSearcher(ITfsTestPlan testPlan) { _tfsTestPlan = testPlan; }