Ejemplo n.º 1
0
 private void CreateOrUpdateModuleLevelSuite(TestSuite projectSuite, RQMProject project)
 {
     IList<RQMModule> modules = RQMServer.GetModulesOfProject(project);
     IList<TestSuite> moduleSuites = TestSuite.GetAllSubSuites(projectSuite);
     //disable all the module level suites firstly
     projectSuite.DisableSubTestSuites();
     //iterate all the modules in RQM server, enable the existing one and add new ones
     foreach (RQMModule m in modules)
     {
         TestSuite moduleSuite = moduleSuites.Where(s => s.Name == m.Title).FirstOrDefault();
         if (null == moduleSuite)
         {
             //add module suite
             TestSuite temp = new TestSuite
             {
                 Name = m.Title,
                 ProviderId = Provider.ProviderId,
                 IsActive = true,
                 Description = string.Format("Title=Module {0} in RQM, Type={1}", m.Title, SuiteType.Static.ToString()),
                 TestCases = null,
                 SubSuites = null,
                 CreateBy = 0,
                 ModityBy = 0,
             };
             moduleSuite = TestSuite.CreateSuite(temp);
             projectSuite.AddSubTestSuite(moduleSuite.SuiteId);
             CreateOrUpdateFeatureLevelSuite(moduleSuite, project);
         }
         else
         {
             moduleSuite.IsActive = true;
             moduleSuite.ProviderId = Provider.ProviderId;
             moduleSuite.Update();
             CreateOrUpdateFeatureLevelSuite(moduleSuite, project);
         }
     }
 }
Ejemplo n.º 2
0
        private void CreateOrUpdateFeatureLevelSuite(TestSuite moduleSuite, RQMProject project)
        {
            IList<RQMFeature> modules = RQMServer.GetFeaturesOfProject(project);
            IList<TestSuite> featureSuites = TestSuite.GetAllSubSuites(moduleSuite);
            moduleSuite.DisableSubTestSuites();
            RQMFeature module = modules.Where(m => m.Title == moduleSuite.Name).FirstOrDefault();
            if (null != module)
            {
                IList<RQMFeature> features = module.SubFeatures;
                foreach (RQMFeature feature in features)
                {
                    TestSuite featureSuite = featureSuites.Where(s => s.Name == feature.Title).FirstOrDefault();
                    if (null == featureSuite)
                    {
                        TestSuite temp = new TestSuite
                        {
                            Name = feature.Title,
                            ProviderId = Provider.ProviderId,
                            IsActive = true,
                            TestCases = null,
                            SubSuites = null,
                            Description = string.Format("Title=Feature {0} in RQM, Type={1}", feature.Title, SuiteType.Static.ToString()),
                            CreateBy = 0,
                            ModityBy = 0,
                        };
                        featureSuite = TestSuite.CreateSuite(temp);
                        moduleSuite.AddSubTestSuite(featureSuite.SuiteId);
                    }
                    else
                    {
                        featureSuite.IsActive = true;
                        featureSuite.ProviderId = Provider.ProviderId;
                        featureSuite.Update();
                    }
                }
            }
            else
            {

            }
        }