Tmx.GatherTestResultsCollections.GatherCollections C# (CSharp) Method

GatherCollections() private method

private GatherCollections ( ISearchCmdletBaseDataObject searchCriteria ) : void
searchCriteria ISearchCmdletBaseDataObject
return void
        public virtual void GatherCollections(ISearchCmdletBaseDataObject searchCriteria)
        {
            // IOrderedEnumerable<ITestSuite> suites = TmxHelper.SearchForSuites(searchCriteria);
            // TestSuites = suites;
            TestSuites = TmxHelper.SearchForSuites(searchCriteria);
            
            // IOrderedEnumerable<ITestScenario> scenarios = TmxHelper.SearchForScenarios(searchCriteria);
            // TestScenarios = scenarios;
            TestScenarios = TmxHelper.SearchForScenarios(searchCriteria);
            
            // IOrderedEnumerable<ITestResult> testResults = TmxHelper.SearchForTestResults(searchCriteria);
            // TestResults = testResults;
            TestResults = TmxHelper.SearchForTestResults(searchCriteria);
        }
        

Same methods

GatherTestResultsCollections::GatherCollections ( ISearchCmdletBaseDataObject searchCriteria, List suitesForSearch ) : void

Usage Example

Beispiel #1
0
        public static void ExportResultsToJUnitXML(ISearchCmdletBaseDataObject cmdlet, string path)
        {
            try {

                var gathered = new GatherTestResultsCollections();
                gathered.GatherCollections(cmdlet);
                
                var testResultsExporter = new TestResultsExporter();
                var suitesElement = testResultsExporter.CreateSuitesXElementWithParameters(
                    gathered.TestSuites,
                    gathered.TestScenarios,
                    gathered.TestResults,
                    (new XMLElementsJUnitStruct()));
                
                var document = new XDocument();
                document.Add(suitesElement);
                document.Save(path);
            }
            catch (Exception eCreateDocument) {
                // 20140720
//                cmdlet.WriteError(
//                    cmdlet,
//                    "Unable to save XML report to the file '" +
//                    path +
//                    "'. " + 
//                    eCreateDocument.Message,
//                    "FailedToSaveReport",
//                    ErrorCategory.InvalidOperation,
//                    true);
                throw new Exception(
                    "Unable to save XML report to the file '" +
                    path +
                    "'. " + 
                    eCreateDocument.Message);
            }
        }
GatherTestResultsCollections