Example #1
0
        public QaInstance(QaType qaType, string username, string name)
        {
            QaTypeName = qaType.Name;
            Name = "uten navn";
			Published = false;
            User = username;
            int idCounter = 0;
            Categories = new List<QaInstanceCategory>();
            ProjectMembers = new List<string>();
            PublishedDate = DateTime.MinValue;

            foreach (CriteriaCategory category in qaType.CriteriaCategories)
            {
                QaInstanceCategory instanceCategory = new QaInstanceCategory(category.Text);
                foreach (QaCriteria criteria in category.Criterias)
                {
                    instanceCategory.Criterias.Add(new QaInstanceCriteria()
                                                  {
                                                      Comment = string.Empty,
                                                      ResolvedAs = ResolvedType.NotSet,
                                                      Id = ++idCounter,
                                                      Text = criteria.Text,
                                                      Status = InstanceCriteriaStatus.NotSet
                                                  });
                }
                Categories.Add(instanceCategory);
            }
        }
 public void SetUp()
 {
     qaType = new QaType()
                     {
                         CriteriaCategories =
                             {
                                 new CriteriaCategory(){ Id = 1, Text = "asd", Criterias = { new QaCriteria() { Id= 1 }, new QaCriteria() { Id = 3}}},
                                 new CriteriaCategory(){ Id = 2, Text = "asd", Criterias = { }},
                                 new CriteriaCategory(){ Id = 5, Text = "asd", Criterias = { new QaCriteria() { Id= 2 }}},
                             }
                     };
 }