Ejemplo n.º 1
0
 public QaInstance CreateQaInstance(int qaTypeId, string username, string qaName)
 {
     QaInstance newQaInstance = new QaInstance(_qaTypeRepository.Get(qaTypeId), username, qaName);
     
     _qaInstanceRepository.SaveQaInstance(newQaInstance);
     return newQaInstance;
 }
Ejemplo n.º 2
0
        public static int GetScoreOutOfSix(QaInstance qa)
        {
            if (qa.GetScore() >= 90)
                return 6;

            double scoreOutOfSix = qa.GetScore() / 16.6;
            return (int)Math.Round(scoreOutOfSix, MidpointRounding.ToEven);
        }
Ejemplo n.º 3
0
        public void QaInstanceConstructor_ValidQaType_QaInstanceHasCorrectNumberOfCriterias()
        {
            QaInstance qaInstance = new QaInstance(qaType, "user", "New QA!");
            int totalCatCount = 0;
            foreach(CriteriaCategory category in qaType.CriteriaCategories)
            {
                totalCatCount += category.Criterias.Count;    
            }

            int instanceCount = 0;
            foreach (QaInstanceCategory category in qaInstance.Categories)
            {
                instanceCount += category.Criterias.Count;
            }
            instanceCount.ShouldBe(totalCatCount);
        }
 public QaInstance SaveQaInstance(QaInstance qa)
 {
     return qa;
 }
Ejemplo n.º 5
0
 public QaInstance SaveQaInstance(QaInstance qa)
 {
     _session.Store(qa);
     _session.SaveChanges();
     return qa;
 }