internal static ITestScenario GetNewTestScenario( string name, string id, string description) { var cmdlet = new AddScenarioCmdletBase(); if (!string.IsNullOrEmpty(name)) cmdlet.Name = name; if (!string.IsNullOrEmpty(id)) cmdlet.Id = id; if (!string.IsNullOrEmpty(description)) cmdlet.Description = description; var command = new TmxAddTestScenarioCommand(cmdlet); command.Execute(); return (ITestScenario)(object)UnitTestOutput.LastOutput[0]; }
internal static ITestScenario AddTestScenario( ITestSuite testSuite, string name, string id, string description, string testSuiteName, string testSuiteId) { var cmdlet = new AddTmxTestScenarioCommand(); if (!string.IsNullOrEmpty(name)) cmdlet.Name = name; if (!string.IsNullOrEmpty(id)) cmdlet.Id = id; if (!string.IsNullOrEmpty(description)) cmdlet.Description = description; if (null == testSuite) { if (!string.IsNullOrEmpty(testSuiteName)) cmdlet.TestSuiteName = testSuiteName; if (!string.IsNullOrEmpty(testSuiteId)) cmdlet.TestSuiteId = testSuiteId; if ((string.IsNullOrEmpty(testSuiteName)) && (string.IsNullOrEmpty(testSuiteId))) cmdlet.InputObject = TestData.CurrentTestSuite; } else { cmdlet.InputObject = (TestSuite)testSuite; } var command = new TmxAddTestScenarioCommand(cmdlet); command.Execute(); return (ITestScenario)TestData.CurrentTestScenario; }