internal static ITestSuite GetNewTestSuite( string name, string id, string description) { NewSuiteCmdletBase cmdlet = new NewSuiteCmdletBase(); //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; } TMXNewTestSuiteCommand command = new TMXNewTestSuiteCommand(cmdlet); command.Execute(); //return (ITestSuite)CommonCmdletBase.UnitTestOutput[CommonCmdletBase.UnitTestOutput.Count - 1]; return((ITestSuite)(object)PSTestLib.UnitTestOutput.LastOutput[0]); }
// internal static ITestSuite GetNewTestSuite( internal static object GetNewTestSuite( string name, string id, string description) { var cmdlet = new NewSuiteCmdletBase(); if (!string.IsNullOrEmpty(name)) { cmdlet.Name = name; } if (!string.IsNullOrEmpty(id)) { cmdlet.Id = id; } if (!string.IsNullOrEmpty(description)) { cmdlet.Description = description; } var command = new TmxNewTestSuiteCommand(cmdlet); command.Execute(); // 20140715 // return (ITestSuite)(object)UnitTestOutput.LastOutput[0]; var returnValue = (object)UnitTestOutput.LastOutput[0]; if (returnValue is ITestSuite) { return(returnValue as ITestSuite); } if (returnValue is ErrorRecord) { return(returnValue as ErrorRecord); } return(returnValue); }