protected override void ProcessRecord()
        {
            // 20140721
            var dataObject = new OpenScenarioCmdletBaseDataObject {
                InputObject = InputObject,
                Name = Name,
                Id = Id,
                // Descriprion = this.Description,
                // 20141203
//                TestSuiteName = this.TestSuiteName,
//                TestSuiteId = this.TestSuiteId,
//                TestPlatformId = this.TestPlatformId
                TestSuiteName = TestSuiteName ?? TestData.CurrentTestSuite.Name,
                TestSuiteId = TestSuiteId ?? TestData.CurrentTestSuite.Id,
                TestPlatformId = TestPlatformId ?? TestData.CurrentTestPlatform.Id
            };
            
            // bool result = TmxHelper.OpenTestScenario(this);
            bool result = TmxHelper.OpenTestScenario(dataObject);
            
            if (result)
                WriteObject(TestData.CurrentTestScenario);
            else
                WriteError(
                    this,
                    "Couldn't open a test scenario",
                    "GettingTestScenario",
                    ErrorCategory.InvalidData,
                    true);
        }
示例#2
0
        protected override void ProcessRecord()
        {
            // 20140721
            var dataObject = new OpenScenarioCmdletBaseDataObject {
                InputObject = InputObject,
                Name        = Name,
                Id          = Id,
                // Descriprion = this.Description,
                // 20141203
//                TestSuiteName = this.TestSuiteName,
//                TestSuiteId = this.TestSuiteId,
//                TestPlatformId = this.TestPlatformId
                TestSuiteName  = TestSuiteName ?? TestData.CurrentTestSuite.Name,
                TestSuiteId    = TestSuiteId ?? TestData.CurrentTestSuite.Id,
                TestPlatformId = TestPlatformId ?? TestData.CurrentTestPlatform.Id
            };

            // bool result = TmxHelper.OpenTestScenario(this);
            bool result = TmxHelper.OpenTestScenario(dataObject);

            if (result)
            {
                WriteObject(TestData.CurrentTestScenario);
            }
            else
            {
                WriteError(
                    this,
                    "Couldn't open a test scenario",
                    "GettingTestScenario",
                    ErrorCategory.InvalidData,
                    true);
            }
        }
示例#3
0
        internal override void Execute()
        {
            var cmdlet = (GetTmxTestScenarioStatusCommand)Cmdlet;

            // 20140721
            var dataObject = new OpenScenarioCmdletBaseDataObject {
                // Description = cmdlet.de
                Id             = cmdlet.Id,
                InputObject    = cmdlet.InputObject,
                Name           = cmdlet.Name,
                TestPlatformId = cmdlet.TestPlatformId,
                TestSuiteId    = cmdlet.TestSuiteId,
                TestSuiteName  = cmdlet.TestSuiteName
            };

            // 20140722
//            if (!string.IsNullOrEmpty(cmdlet.Name))
//                // 20140721
//                // TmxHelper.GetTestScenarioStatus(cmdlet, cmdlet.FilterOutAutomaticResults);
//                TmxHelper.GetTestScenarioStatus(dataObject, cmdlet.FilterOutAutomaticResults);
//            else if (!string.IsNullOrEmpty(cmdlet.Id))
//                // 20140721
//                // TmxHelper.GetTestScenarioStatus(cmdlet, cmdlet.FilterOutAutomaticResults);
//                TmxHelper.GetTestScenarioStatus(dataObject, cmdlet.FilterOutAutomaticResults);
            if (!string.IsNullOrEmpty(cmdlet.Name) || !string.IsNullOrEmpty(cmdlet.Id))
            {
                cmdlet.WriteObject(TmxHelper.GetTestScenarioStatus(dataObject, cmdlet.FilterOutAutomaticResults));
            }
            else
            {
                cmdlet.WriteError(
                    cmdlet,
                    "Failed to find test scenario with name = '" +
                    cmdlet.Name +
                    "' and id = '" +
                    cmdlet.Id +
                    "'",
                    "FailedToFindTestScenario",
                    ErrorCategory.InvalidArgument,
                    true);
            }
        }
        internal override void Execute()
        {
            var cmdlet = (GetTmxTestScenarioStatusCommand)Cmdlet;
            
            // 20140721
            var dataObject = new OpenScenarioCmdletBaseDataObject {
                // Description = cmdlet.de
                Id = cmdlet.Id,
                InputObject = cmdlet.InputObject,
                Name = cmdlet.Name,
                TestPlatformId = cmdlet.TestPlatformId,
                TestSuiteId = cmdlet.TestSuiteId,
                TestSuiteName = cmdlet.TestSuiteName
            };
            
            // 20140722
//            if (!string.IsNullOrEmpty(cmdlet.Name))
//                // 20140721
//                // TmxHelper.GetTestScenarioStatus(cmdlet, cmdlet.FilterOutAutomaticResults);
//                TmxHelper.GetTestScenarioStatus(dataObject, cmdlet.FilterOutAutomaticResults);
//            else if (!string.IsNullOrEmpty(cmdlet.Id))
//                // 20140721
//                // TmxHelper.GetTestScenarioStatus(cmdlet, cmdlet.FilterOutAutomaticResults);
//                TmxHelper.GetTestScenarioStatus(dataObject, cmdlet.FilterOutAutomaticResults);
            if (!string.IsNullOrEmpty(cmdlet.Name) || !string.IsNullOrEmpty(cmdlet.Id))
                cmdlet.WriteObject(TmxHelper.GetTestScenarioStatus(dataObject, cmdlet.FilterOutAutomaticResults));
            else
                cmdlet.WriteError(
                    cmdlet,
                    "Failed to find test scenario with name = '" +
                    cmdlet.Name +
                    "' and id = '" +
                    cmdlet.Id +
                    "'",
                    "FailedToFindTestScenario",
                    ErrorCategory.InvalidArgument,
                    true);
        }