Esempio n. 1
0
 public TestSetInfo(TestSetName testSetName, String testSetStringShort, String testSetStringLong, List <TestName> testNames)
 {
     this.testSetName        = testSetName;
     this.testSetStringShort = testSetStringShort;
     this.testSetStringLong  = testSetStringLong;
     this.testNames          = testNames;
 }
Esempio n. 2
0
        private TestSetFolder CreateTestSetNames(List <string> TestSetNames, TestSetFolder TSFolder)
        {
            List <ItemValue> tcList = new List <ItemValue>();

            #region Generate TestSet Name
            //Get all match test cases and store it to a List
            try
            {
                ICommand com        = tdConn.Command as ICommand;
                string[] columnName = { "TS_TEST_ID", configFile.CaseFilter.TestSetName };

                string sqlCommand = GenerateSQLText(columnName);
                com.CommandText = sqlCommand;

                IRecordset recList = com.Execute() as IRecordset;

                recList.First();
                for (int num = 0; num < recList.RecordCount; num++)
                {
                    ItemValue tc = new ItemValue();
                    tc.Test_ID = recList["TS_TEST_ID"].ToString();
                    if (recList[configFile.CaseFilter.TestSetName] != null)
                    {
                        tc.Test_Custom = recList[configFile.CaseFilter.TestSetName].ToString();
                    }
                    tcList.Insert(0, tc);
                    recList.Next();
                }
            }
            catch (Exception e)
            {
                AutoLog.Info("AutoIntSys: Exception with " + e.Message);
                AutoLog.Info("AutoIntSys: Fail to get Specified Field Value from TEST Table!");
                //Debug.Print("AutoIntSys:Fail to get Specified Field Value from TEST Table!");
                //Debug.Print("AutoIntSys:" + e);
                return(null);
            }
            #endregion

            #region Generate TestSet
            try
            {
                TestSetFactory TSFact   = TSFolder.TestSetFactory as TestSetFactory;
                TestFactory    TestFact = tdConn.TestFactory as TestFactory;
                foreach (string TSName in TestSetNames)
                {
                    TestSet       TestSetName;
                    TSTestFactory TSTestFact;

                    TestSetName = TSFact.AddItem(TSName) as TestSet;
                    TestSetName.Post();
                    TSTestFact = TestSetName.TSTestFactory as TSTestFactory;

                    foreach (ItemValue t in tcList)
                    {
                        if (t.Test_Custom == TSName)
                        {
                            TSTestFact.AddItem(t.Test_ID);
                        }
                    }
                }

                createTSSucess = true;
                return(TSFolder);
            }
            catch (Exception e)
            {
                AutoLog.Info("AutoIntSys: Exception with " + e.Message);
                AutoLog.Info("AutoIntSys: Create Test Sets Error!");
                //Debug.Print("AutoIntSys:Create Test Sets Error!");
                //Debug.Print("AutoIntSys:" + e.Message);
                return(null);
            }
            #endregion
        }