예제 #1
0
        internal static ITestScenario AddTestScenario(
            ITestSuite testSuite,
            string name,
            string id,
            string description,
            string testSuiteName,
            string testSuiteId)
        {
            AddTMXTestScenarioCommand cmdlet =
                new AddTMXTestScenarioCommand();

            //cmdlet.UnitTestMode = true;
            if (null != name && string.Empty != name)
            {
                cmdlet.Name = name;
            }
            if (null != id && string.Empty != id)
            {
                cmdlet.Id = id;
            }
            if (null != description && string.Empty != description)
            {
                cmdlet.Description = description;
            }
            if (null == testSuite)
            {
                if (null != testSuiteName && string.Empty != testSuiteName)
                {
                    cmdlet.TestSuiteName = testSuiteName;
                }
                if (null != testSuiteId && string.Empty != testSuiteId)
                {
                    cmdlet.TestSuiteId = testSuiteId;
                }

                if ((null == testSuiteName || string.Empty == testSuiteName) &&
                    (null == testSuiteId || string.Empty == testSuiteId))
                {
                    cmdlet.InputObject =
                        TestData.CurrentTestSuite;
                }
            }
            else
            {
                cmdlet.InputObject =
                    (TestSuite)testSuite;
            }

            TMXAddTestScenarioCommand command =
                new TMXAddTestScenarioCommand(cmdlet);

            command.Execute();

            return((ITestScenario)TMX.TestData.CurrentTestScenario);
        }
예제 #2
0
 /// <summary>
 /// Processes the pipeline.
 /// </summary>
 protected override void ProcessRecord()
 {
     TMXAddTestScenarioCommand command =
         new TMXAddTestScenarioCommand(this);
     command.Execute();
 }