Пример #1
0
        protected override void BeginProcessing()
        {
            CheckCmdletParameters();

            var cmdlet = new SearchCmdletBase {
                FilterAll = true
            };

//            System.Data.DataSet dataSet =
//                new System.Data.DataSet();
//            System.Data.DataTable tableSuites =
//                new System.Data.DataTable("suites");
//            tableSuites.Columns.AddRange(
//                new DataColumn[] {
//                    new DataColumn("Id", typeof(System.String)),
//                    new DataColumn("Name", typeof(System.String)),
//                    new DataColumn("Status", typeof(System.String)),
//                    new DataColumn("TimeSpent", typeof(System.Int32)),
//                    new DataColumn("Passed", typeof(System.Int32)),
//                    new DataColumn("Failed", typeof(System.Int32)),
//                    new DataColumn("NotTested", typeof(System.Int32))
//                }
//               );

//            System.Data.IDataAdapter adapter =
//                new System.Data.data

//            OleDbDataAdapter da =
//                new OleDbDataAdapter();
//            da.

//            IOrderedEnumerable<TestSuite> suitesCollection =
//                TmxHelper.SearchForSuites(cmdlet);
//            foreach (TestSuite testSuite in suitesCollection) {
//                DataRow row = tableSuites.NewRow();
//                //row.
//            }

            // 20140720
            // var dataObject = new SearchCmdletBaseDataObject { FilterAll = true };
            // 20140721
            var dataObject = new SearchCmdletBaseDataObject {
                Descending = cmdlet.Descending,
                FilterAll  = cmdlet.FilterAll,
                FilterDescriptionContains = cmdlet.FilterDescriptionContains,
                FilterFailed       = cmdlet.FilterFailed,
                FilterIdContains   = cmdlet.FilterIdContains,
                FilterNameContains = cmdlet.FilterNameContains,
                FilterNone         = cmdlet.FilterNone,
                FilterNotTested    = cmdlet.FilterNotTested,
                FilterOutAutomaticAndTechnicalResults = cmdlet.FilterOutAutomaticAndTechnicalResults,
                FilterOutAutomaticResults             = cmdlet.FilterOutAutomaticResults,
                FilterPassed             = cmdlet.FilterPassed,
                FilterPassedWithBadSmell = cmdlet.FilterPassedWithBadSmell,
                Id               = cmdlet.Id,
                Name             = cmdlet.Name,
                OrderByDateTime  = cmdlet.OrderByDateTime,
                OrderByFailRate  = cmdlet.OrderByFailRate,
                OrderById        = cmdlet.OrderById,
                OrderByName      = cmdlet.OrderByName,
                OrderByPassRate  = cmdlet.OrderByPassRate,
                OrderByTimeSpent = cmdlet.OrderByTimeSpent
            };

//            TmxHelper.SearchForScenarios(cmdlet);
//            TmxHelper.SearchForTestResults(cmdlet);
            TmxHelper.SearchForScenarios(dataObject);
            TmxHelper.SearchForTestResults(dataObject);
        }
Пример #2
0
        protected override void BeginProcessing()
        {
            CheckCmdletParameters();

            var cmdlet = new SearchCmdletBase {
                FilterAll = true
            };

            // 20140720
//            var dataObject = new SearchCmdletBaseDataObject {
//                FilterAll = true
//            };
            // 20140721
            var dataObject = new SearchCmdletBaseDataObject {
                Descending = cmdlet.Descending,
                FilterAll  = cmdlet.FilterAll,
                FilterDescriptionContains = cmdlet.FilterDescriptionContains,
                FilterFailed       = cmdlet.FilterFailed,
                FilterIdContains   = cmdlet.FilterIdContains,
                FilterNameContains = cmdlet.FilterNameContains,
                FilterNone         = cmdlet.FilterNone,
                FilterNotTested    = cmdlet.FilterNotTested,
                FilterOutAutomaticAndTechnicalResults = cmdlet.FilterOutAutomaticAndTechnicalResults,
                FilterOutAutomaticResults             = cmdlet.FilterOutAutomaticResults,
                FilterPassed             = cmdlet.FilterPassed,
                FilterPassedWithBadSmell = cmdlet.FilterPassedWithBadSmell,
                Id               = cmdlet.Id,
                Name             = cmdlet.Name,
                OrderByDateTime  = cmdlet.OrderByDateTime,
                OrderByFailRate  = cmdlet.OrderByFailRate,
                OrderById        = cmdlet.OrderById,
                OrderByName      = cmdlet.OrderByName,
                OrderByPassRate  = cmdlet.OrderByPassRate,
                OrderByTimeSpent = cmdlet.OrderByTimeSpent
            };
            // IOrderedEnumerable<TestSuite> suites =
            IOrderedEnumerable <ITestSuite> suites = TmxHelper.SearchForSuites(dataObject);

            cmdlet.FilterNone = true;

            IOrderedEnumerable <ITestScenario> scenarios = TmxHelper.SearchForScenarios(dataObject);

            //cmdlet.FilterAll = false;
            //cmdlet.FilterPassedWithBadSmell = true;
//            cmdlet.FilterNone = true;

            IOrderedEnumerable <ITestResult> testResults = TmxHelper.SearchForTestResults(dataObject);

            // 20141124
//            XElement suitesElement =
//                TmxHelper.CreateSuitesXElementWithParameters(
//                    suites,
//                    scenarios,
//                    testResults,
//                    (new XMLElementsNativeStruct()));

            var testResultsExporter = new TestResultsExporter();
            var suitesElement       = testResultsExporter.CreateSuitesXElementWithParameters(
                suites,
                scenarios,
                testResults,
                (new XMLElementsNativeStruct()));

            WriteObject(this, suitesElement);
        }