GetProjectTestPlans() public method

get a list of all testplans for a project
public GetProjectTestPlans ( int projectid ) : List
projectid int
return List
Example #1
0
        /// <summary>
        /// get the specific project and associated plans for this TestLinkFixture
        /// </summary>
        /// <param name="tlfa"></param>
        /// <returns>a valid testplanID or 0 if testplan or project was not found</returns>
        private int GetProjectAndPlans(TestLinkFixtureAttribute tlfa)
        {
            // make sure proxy is right
            SetupProxy(tlfa);
            int testPlanId = 0;

            if ((currentProject == null) || (currentProject.name != tlfa.ProjectName))
            {
                currentProject = null;
                plans          = null;
                foreach (TestProject project in allProjects)
                {
                    if (project.name == tlfa.ProjectName)
                    {
                        currentProject = project;
                        plans          = proxy.GetProjectTestPlans(project.id);
                        break;
                    }
                }
                if (currentProject == null)
                {
                    return(0);
                }
            }
            // now that currentProject and plans are up to date
            foreach (TestPlan plan in plans)
            {
                if (plan.name == tlfa.TestPlan)
                {
                    testPlanId = plan.id;
                    break;
                }
            }
            return(testPlanId);
        }