Пример #1
0
//        public static void GetTestSubSuite(TLSCmdletBase cmdlet, string name)
//        {
//            throw new NotImplementedException();
//        }

//        public static void OpenTestSubSuite(TLSCmdletBase cmdlet, string name)
//        {
//            throw new NotImplementedException();
//        }

        public static void AddTestCase(
            TLSCmdletBase cmdlet,
            string name,
            string authorLogin,
            int suiteId,
            int testProjectId,
            string summary,
            string[] keyword,
            int order,
            bool checkDuplicatedName,
            ActionOnDuplicatedName actionDuplicatedName,
            int executionType,
            int importance)
        {
            string keywords = string.Empty;

            if (null != keyword && 0 < keyword.Length)
            {
                foreach (string singleKeyword in keyword)
                {
                    keywords += singleKeyword;
                }
            }

            if (null == TLAddinData.CurrentTestProject)
            {
                //
                Console.WriteLine("!!!");
                //
            }

            if (null == actionDuplicatedName)
            {
                actionDuplicatedName = ActionOnDuplicatedName.CreateNewVersion;
            }

            TLAddinData.CurrentTestLinkConnection.CreateTestCase(
                authorLogin,
                suiteId,
                name,
                testProjectId,
                summary,
                keywords,
                order,
                checkDuplicatedName,
                actionDuplicatedName,
                executionType,
                importance);
            //

            //TLAddinData.CurrentTestLinkConnection.ReportTCResult
        }
Пример #2
0
        /// <summary>
        /// Create a new Test Case
        /// </summary>
        /// <param name="authorLogin">login id of test case author</param>
        /// <param name="testsuiteid">Id of test suite</param>
        /// <param name="testcasename">name of test case</param>
        /// <param name="testprojectid">id of test project</param>
        /// <param name="summary">summary of result</param>
        /// <param name="steps">Array of test steps</param>
        /// <param name="keywords"></param>
        /// <param name="order">defaultOrder = 0, otherwise location in sequence to other testcases</param>
        /// <param name="checkduplicatedname">1=yes, 0=no</param>
        /// <param name="actiononduplicatedname">one of block, generate_new, create_new_version</param>
        /// <param name="executiontype">manual:1, automated: 2, </param>
        /// <param name="importance">Importance of test case</param>
        public GeneralResult CreateTestCase(string authorLogin, int testsuiteid, string testcasename, int testprojectid, string summary, TestStep[] steps, string keywords, int order, bool checkduplicatedname, ActionOnDuplicatedName actiononduplicatedname,
		int executiontype, int importance)
        {
            string actionFlag = "block";
            switch (actiononduplicatedname) {
                case ActionOnDuplicatedName.Block:
                    actionFlag = "block";
                    break;
                case ActionOnDuplicatedName.CreateNewVersion:
                    actionFlag = "create_new_version";
                    break;
                case ActionOnDuplicatedName.GenerateNew:
                    actionFlag = "generate_new";
                    break;
            }

            stateIsValid();
            object response = proxy.createTestCase(devkey, authorLogin, testsuiteid, testcasename, testprojectid, summary, steps, keywords, order, checkduplicatedname ? 1 : 0,
            actionFlag, executiontype, importance);

            handleErrorMessage(response);

            if (response is object[]) {
                object[] list = response as object[];
                foreach (XmlRpcStruct data in list)
                    return new GeneralResult(data);
            }
            return null;
        }
Пример #3
0
        /// <summary>
        /// create a new Testcase without having to specify test steps
        /// </summary>
        /// <summary>
        /// Create a new Test Case
        /// </summary>
        /// <param name="authorLogin">login id of test case author</param>
        /// <param name="testsuiteid">Id of test suite</param>
        /// <param name="testcasename">name of test case</param>
        /// <param name="testprojectid">id of test project</param>
        /// <param name="summary">summary of result</param>
        /// <param name="keywords"></param>
        /// <param name="order">defaultOrder = 0, otherwise location in sequence to other testcases</param>
        /// <param name="checkduplicatedname">1=yes, 0=no</param>
        /// <param name="actiononduplicatedname">one of block, generate_new, create_new_version</param>
        /// <param name="executiontype">manual:1, automated: 2, </param>
        /// <param name="importance">Importance of test case</param>
        public GeneralResult CreateTestCase(string authorLogin, int testsuiteid, string testcasename, int testprojectid, string summary, string keywords, int order, bool checkduplicatedname, ActionOnDuplicatedName actiononduplicatedname, int executiontype,
		int importance)
        {
            return CreateTestCase(authorLogin, testsuiteid, testcasename, testprojectid, summary, new TestStep[0], keywords, order, checkduplicatedname, actiononduplicatedname,
            executiontype, importance);
        }
Пример #4
0
//        public static void GetTestSubSuite(TLSCmdletBase cmdlet, string name)
//        {
//            throw new NotImplementedException();
//        }
        
//        public static void OpenTestSubSuite(TLSCmdletBase cmdlet, string name)
//        {
//            throw new NotImplementedException();
//        }
        
        public static void AddTestCase(
            TLSCmdletBase cmdlet, 
            string name,
            string authorLogin,
            int suiteId,
            int testProjectId,
            string summary,
            string[] keyword,
            int order,
            bool checkDuplicatedName,
            ActionOnDuplicatedName actionDuplicatedName,
            int executionType,
            int importance)
        {
            string keywords = string.Empty;
            if (null != keyword && 0 < keyword.Length) {
                foreach (string singleKeyword in keyword) {
                    keywords += singleKeyword;
                }
            }
            
            if (null == TLAddinData.CurrentTestProject) {
                //
Console.WriteLine("!!!");
                //
            }
            
            if (null == actionDuplicatedName) {
                actionDuplicatedName = ActionOnDuplicatedName.CreateNewVersion;
            }
            
            TLAddinData.CurrentTestLinkConnection.CreateTestCase(
                authorLogin,
                suiteId,
                name,
                testProjectId,
                summary,
                keywords,
                order,
                checkDuplicatedName,
                actionDuplicatedName,
                executionType,
                importance);
            //
            
            //TLAddinData.CurrentTestLinkConnection.ReportTCResult
        }